Chris
commited on
Commit
Β·
3a3e679
1
Parent(s):
95e7104
Final 5.7.3
Browse files- src/__pycache__/app.cpython-310.pyc +0 -0
- src/app.py +17 -9
src/__pycache__/app.cpython-310.pyc
CHANGED
|
Binary files a/src/__pycache__/app.cpython-310.pyc and b/src/__pycache__/app.cpython-310.pyc differ
|
|
|
src/app.py
CHANGED
|
@@ -238,6 +238,7 @@ def check_oauth_scopes(oauth_token: str) -> Dict[str, any]:
|
|
| 238 |
"scopes": [],
|
| 239 |
"can_inference": False,
|
| 240 |
"can_read": False,
|
|
|
|
| 241 |
"message": "Not logged in"
|
| 242 |
}
|
| 243 |
|
|
@@ -278,7 +279,7 @@ def check_oauth_scopes(oauth_token: str) -> Dict[str, any]:
|
|
| 278 |
"avatar": user_data.get("avatarUrl", "")
|
| 279 |
}
|
| 280 |
except:
|
| 281 |
-
|
| 282 |
|
| 283 |
return {
|
| 284 |
"logged_in": True,
|
|
@@ -295,6 +296,7 @@ def check_oauth_scopes(oauth_token: str) -> Dict[str, any]:
|
|
| 295 |
"scopes": ["unknown"],
|
| 296 |
"can_inference": False,
|
| 297 |
"can_read": False,
|
|
|
|
| 298 |
"message": f"Could not determine scopes: {str(e)}"
|
| 299 |
}
|
| 300 |
|
|
@@ -318,16 +320,22 @@ Please log in to access GAIA evaluation features.
|
|
| 318 |
|
| 319 |
status_parts = [f"### π Authentication Status: Logged In as {username}"]
|
| 320 |
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
|
| 326 |
-
|
|
|
|
|
|
|
| 327 |
status_parts.append("")
|
| 328 |
status_parts.append("**Available Features:**")
|
| 329 |
|
| 330 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
status_parts.extend([
|
| 332 |
"- β
**Advanced Model Access**: Full Qwen model capabilities",
|
| 333 |
"- β
**High Performance**: 30%+ expected GAIA score",
|
|
@@ -340,7 +348,7 @@ Please log in to access GAIA evaluation features.
|
|
| 340 |
"- β
**Reliable Responses**: Rule-based answers for common questions"
|
| 341 |
])
|
| 342 |
|
| 343 |
-
if
|
| 344 |
status_parts.append("- β
**Profile Access**: Can read user information")
|
| 345 |
|
| 346 |
status_parts.extend([
|
|
@@ -348,7 +356,7 @@ Please log in to access GAIA evaluation features.
|
|
| 348 |
"- β
**Official Evaluation**: GAIA benchmark submission"
|
| 349 |
])
|
| 350 |
|
| 351 |
-
if not
|
| 352 |
status_parts.extend([
|
| 353 |
"",
|
| 354 |
"π‘ **Note**: Your OAuth token has limited scopes (common with Gradio OAuth).",
|
|
|
|
| 238 |
"scopes": [],
|
| 239 |
"can_inference": False,
|
| 240 |
"can_read": False,
|
| 241 |
+
"user_info": {},
|
| 242 |
"message": "Not logged in"
|
| 243 |
}
|
| 244 |
|
|
|
|
| 279 |
"avatar": user_data.get("avatarUrl", "")
|
| 280 |
}
|
| 281 |
except:
|
| 282 |
+
user_info = {}
|
| 283 |
|
| 284 |
return {
|
| 285 |
"logged_in": True,
|
|
|
|
| 296 |
"scopes": ["unknown"],
|
| 297 |
"can_inference": False,
|
| 298 |
"can_read": False,
|
| 299 |
+
"user_info": {},
|
| 300 |
"message": f"Could not determine scopes: {str(e)}"
|
| 301 |
}
|
| 302 |
|
|
|
|
| 320 |
|
| 321 |
status_parts = [f"### π Authentication Status: Logged In as {username}"]
|
| 322 |
|
| 323 |
+
# Safely access user_info
|
| 324 |
+
user_info = scope_info.get("user_info", {})
|
| 325 |
+
if user_info and user_info.get("fullname"):
|
| 326 |
+
status_parts.append(f"**Full Name**: {user_info['fullname']}")
|
| 327 |
|
| 328 |
+
# Safely access scopes
|
| 329 |
+
scopes = scope_info.get("scopes", [])
|
| 330 |
+
status_parts.append(f"**Scopes**: {', '.join(scopes) if scopes else 'None detected'}")
|
| 331 |
status_parts.append("")
|
| 332 |
status_parts.append("**Available Features:**")
|
| 333 |
|
| 334 |
+
# Safely access capabilities
|
| 335 |
+
can_inference = scope_info.get("can_inference", False)
|
| 336 |
+
can_read = scope_info.get("can_read", False)
|
| 337 |
+
|
| 338 |
+
if can_inference:
|
| 339 |
status_parts.extend([
|
| 340 |
"- β
**Advanced Model Access**: Full Qwen model capabilities",
|
| 341 |
"- β
**High Performance**: 30%+ expected GAIA score",
|
|
|
|
| 348 |
"- β
**Reliable Responses**: Rule-based answers for common questions"
|
| 349 |
])
|
| 350 |
|
| 351 |
+
if can_read:
|
| 352 |
status_parts.append("- β
**Profile Access**: Can read user information")
|
| 353 |
|
| 354 |
status_parts.extend([
|
|
|
|
| 356 |
"- β
**Official Evaluation**: GAIA benchmark submission"
|
| 357 |
])
|
| 358 |
|
| 359 |
+
if not can_inference:
|
| 360 |
status_parts.extend([
|
| 361 |
"",
|
| 362 |
"π‘ **Note**: Your OAuth token has limited scopes (common with Gradio OAuth).",
|