Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import requests
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
import google.generativeai as genai
|
|
|
|
| 7 |
|
| 8 |
# (Keep Constants as is)
|
| 9 |
# --- Constants ---
|
|
@@ -11,7 +12,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 11 |
|
| 12 |
# --- Basic Agent Definition ---
|
| 13 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 14 |
-
|
| 15 |
class BasicAgent:
|
| 16 |
def __init__(self):
|
| 17 |
print("Initializing Gemini Agent...")
|
|
@@ -37,7 +38,7 @@ class BasicAgent:
|
|
| 37 |
except Exception as e:
|
| 38 |
print(f"Error calling Gemini API: {e}")
|
| 39 |
return f"Error during Gemini API call: {e}"
|
| 40 |
-
|
| 41 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 42 |
"""
|
| 43 |
Fetches all questions, runs the BasicAgent on them, submits all answers,
|
|
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
import google.generativeai as genai
|
| 7 |
+
import spaces
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
| 10 |
# --- Constants ---
|
|
|
|
| 12 |
|
| 13 |
# --- Basic Agent Definition ---
|
| 14 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 15 |
+
|
| 16 |
class BasicAgent:
|
| 17 |
def __init__(self):
|
| 18 |
print("Initializing Gemini Agent...")
|
|
|
|
| 38 |
except Exception as e:
|
| 39 |
print(f"Error calling Gemini API: {e}")
|
| 40 |
return f"Error during Gemini API call: {e}"
|
| 41 |
+
@spaces.GPU
|
| 42 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 43 |
"""
|
| 44 |
Fetches all questions, runs the BasicAgent on them, submits all answers,
|