Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -136,7 +136,7 @@ class SmartAgent:
|
|
| 136 |
if not self.api_key:
|
| 137 |
raise ValueError("GROQ_API_KEY not set!")
|
| 138 |
self.api_url = "https://api.groq.com/openai/v1/chat/completions"
|
| 139 |
-
self.model = "llama-3.3-70b-
|
| 140 |
print(f"SmartAgent initialized with Groq ({self.model})")
|
| 141 |
|
| 142 |
def call_llm(self, prompt: str) -> str:
|
|
@@ -200,8 +200,8 @@ RULES:
|
|
| 200 |
history = []
|
| 201 |
initial_prompt = f"{system}\n\nQuestion: {question}{file_alert}"
|
| 202 |
|
| 203 |
-
for iteration in range(
|
| 204 |
-
time.sleep(
|
| 205 |
|
| 206 |
# Build prompt from system + question + last 3 exchanges only
|
| 207 |
if not history:
|
|
@@ -309,7 +309,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 309 |
print(f"Error on task {task_id}: {e}")
|
| 310 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"ERROR: {e}"})
|
| 311 |
|
| 312 |
-
time.sleep(
|
| 313 |
|
| 314 |
if not answers_payload:
|
| 315 |
return "Agent did not produce any answers.", pd.DataFrame(results_log)
|
|
|
|
| 136 |
if not self.api_key:
|
| 137 |
raise ValueError("GROQ_API_KEY not set!")
|
| 138 |
self.api_url = "https://api.groq.com/openai/v1/chat/completions"
|
| 139 |
+
self.model = "llama-3.3-70b-versatile"
|
| 140 |
print(f"SmartAgent initialized with Groq ({self.model})")
|
| 141 |
|
| 142 |
def call_llm(self, prompt: str) -> str:
|
|
|
|
| 200 |
history = []
|
| 201 |
initial_prompt = f"{system}\n\nQuestion: {question}{file_alert}"
|
| 202 |
|
| 203 |
+
for iteration in range(6):
|
| 204 |
+
time.sleep(15)
|
| 205 |
|
| 206 |
# Build prompt from system + question + last 3 exchanges only
|
| 207 |
if not history:
|
|
|
|
| 309 |
print(f"Error on task {task_id}: {e}")
|
| 310 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"ERROR: {e}"})
|
| 311 |
|
| 312 |
+
time.sleep(30)
|
| 313 |
|
| 314 |
if not answers_payload:
|
| 315 |
return "Agent did not produce any answers.", pd.DataFrame(results_log)
|