Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,8 +17,11 @@ agent = PostpartumResearchAgent()
|
|
| 17 |
def answer_question(question):
|
| 18 |
return agent.run(question)
|
| 19 |
|
| 20 |
-
def submit_to_gaia(profile):
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
| 22 |
space_id = os.getenv("SPACE_ID") or "your-username/your-space"
|
| 23 |
agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
|
| 24 |
|
|
@@ -61,7 +64,7 @@ with gr.Blocks() as demo:
|
|
| 61 |
|
| 62 |
with gr.Column():
|
| 63 |
gr.Markdown("### 🌍 Submit Your Agent to GAIA Leaderboard")
|
| 64 |
-
|
| 65 |
submit_output = gr.Textbox(label="Submission Result", lines=10)
|
| 66 |
submit_btn = gr.Button("Submit to GAIA")
|
| 67 |
|
|
|
|
| 17 |
def answer_question(question):
|
| 18 |
return agent.run(question)
|
| 19 |
|
| 20 |
+
def submit_to_gaia(profile: gr.OAuthProfile):
|
| 21 |
+
if profile is None:
|
| 22 |
+
return "❌ Please log in to Hugging Face first!"
|
| 23 |
+
username = profile.username
|
| 24 |
+
# rest of your logic...
|
| 25 |
space_id = os.getenv("SPACE_ID") or "your-username/your-space"
|
| 26 |
agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
|
| 27 |
|
|
|
|
| 64 |
|
| 65 |
with gr.Column():
|
| 66 |
gr.Markdown("### 🌍 Submit Your Agent to GAIA Leaderboard")
|
| 67 |
+
gr.LoginButton() # ✅ Adds login button to the UI
|
| 68 |
submit_output = gr.Textbox(label="Submission Result", lines=10)
|
| 69 |
submit_btn = gr.Button("Submit to GAIA")
|
| 70 |
|