avi080704 commited on
Commit
d0f3ecb
·
verified ·
1 Parent(s): af80fb0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import re
3
  import json
4
  import io
 
5
  import traceback
6
  import contextlib
7
  import tempfile
@@ -12,8 +13,19 @@ import pandas as pd
12
 
13
  # --- Constants ---
14
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
15
- GROQ_MODEL = os.getenv("GROQ_MODEL", "llama-3.3-70b-versatile")
16
- MAX_TOOL_ITERATIONS = 8
 
 
 
 
 
 
 
 
 
 
 
17
 
18
 
19
  # ---------------------------------------------------------------------------
 
2
  import re
3
  import json
4
  import io
5
+ import time
6
  import traceback
7
  import contextlib
8
  import tempfile
 
13
 
14
  # --- Constants ---
15
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
16
+ # Primary model first, then fallbacks used when rate-limited.
17
+ # llama-3.1-8b-instant has much higher daily token quota on the free tier.
18
+ GROQ_MODELS = [
19
+ m.strip()
20
+ for m in os.getenv(
21
+ "GROQ_MODELS",
22
+ "llama-3.3-70b-versatile,llama-3.1-8b-instant",
23
+ ).split(",")
24
+ if m.strip()
25
+ ]
26
+ MAX_TOOL_ITERATIONS = 6
27
+ TOOL_RESULT_MAX_CHARS = 3000
28
+ ANSWER_CACHE_PATH = os.getenv("ANSWER_CACHE_PATH", "answers_cache.json")
29
 
30
 
31
  # ---------------------------------------------------------------------------