iPr0x commited on
Commit
7bb47df
·
verified ·
1 Parent(s): a9a88cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py CHANGED
@@ -35,6 +35,24 @@ OPENROUTER_API_KEY = os.getenv("OPENROUTER_API_KEY")
35
  OPENROUTER_MODEL = os.getenv("OPENROUTER_MODEL", "meta-llama/llama-3.3-70b-instruct:free")
36
  CEREBRAS_API_KEY = os.getenv("CEREBRAS_API_KEY")
37
  MISTRAL_API_KEY = os.getenv("MISTRAL_API_KEY")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  ANY_KEY = bool(
39
  CEREBRAS_API_KEY or MISTRAL_API_KEY or GROQ_API_KEY
40
  or OPENROUTER_API_KEY or GEMINI_API_KEY or HF_TOKEN
@@ -343,6 +361,10 @@ def run_and_submit_all(profile: gr.OAuthProfile | None = None):
343
  task_id = item["task_id"]
344
  question = item["question"]
345
  file_name = item.get("file_name") or ""
 
 
 
 
346
  err = ""
347
  try:
348
  ans = agent(question, task_id, file_name)
 
35
  OPENROUTER_MODEL = os.getenv("OPENROUTER_MODEL", "meta-llama/llama-3.3-70b-instruct:free")
36
  CEREBRAS_API_KEY = os.getenv("CEREBRAS_API_KEY")
37
  MISTRAL_API_KEY = os.getenv("MISTRAL_API_KEY")
38
+ # Only attempt the questions most likely to be solved with free-tier limits.
39
+ # Set a RUN_ALL variable (any value) in Space settings to attempt all 20.
40
+ RUN_ALL = bool(os.getenv("RUN_ALL"))
41
+ PRIORITY_IDS = {
42
+ "2d83110e-a098-4ebb-9987-066c06fa42d0", # reversed sentence
43
+ "6f37996b-2ac7-44b0-8e68-6d28256631b4", # commutativity table
44
+ "3cef3a44-215e-4aed-8e3b-b1e3f08063b7", # botanical vegetables
45
+ "f918266a-b3e0-4914-865d-4faa564f1aef", # python code output
46
+ "7bd855d8-463d-4ed5-93ca-5fe35145f733", # excel food sales
47
+ "8e867cd7-cff9-4e6c-867a-ff5ddc2550be", # Mercedes Sosa albums
48
+ "3f57289b-8c60-48be-bd80-01f8099ca449", # 1977 Yankees walks
49
+ "cf106601-ab4f-4af9-b045-5295fe67b37d", # 1928 Olympics
50
+ "a0c07678-e491-4bbc-8f0b-07405144218f", # Tamai pitchers
51
+ "5a0c1adf-205e-4841-a666-7c3ef95def9d", # Malko Competition
52
+ "305ac316-eef6-4446-960a-92d80d542f82", # Polish Raymond actor
53
+ "4fc2f1ae-8625-45b5-ab34-ad4433bc21f8", # dinosaur featured article
54
+ "bda648d7-d618-4883-88f4-3466eabd860e", # Nedoshivina specimens
55
+ }
56
  ANY_KEY = bool(
57
  CEREBRAS_API_KEY or MISTRAL_API_KEY or GROQ_API_KEY
58
  or OPENROUTER_API_KEY or GEMINI_API_KEY or HF_TOKEN
 
361
  task_id = item["task_id"]
362
  question = item["question"]
363
  file_name = item.get("file_name") or ""
364
+ if not RUN_ALL and task_id not in PRIORITY_IDS:
365
+ answers.append({"task_id": task_id, "submitted_answer": ""})
366
+ log.append({"Task ID": task_id, "Question": question[:80], "Submitted Answer": "", "Error": ""})
367
+ continue
368
  err = ""
369
  try:
370
  ans = agent(question, task_id, file_name)