Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
26 |
model_id="gpt-4o", # ✅ valid OpenAI model name
|
27 |
api_key=os.environ["OPENAI_API_KEY"] # ✅ securely load from environment
|
28 |
),
|
29 |
-
max_steps=
|
30 |
verbosity_level=2
|
31 |
)
|
32 |
except Exception as e:
|
@@ -40,7 +40,7 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
40 |
try:
|
41 |
response = requests.get(questions_url, timeout=15)
|
42 |
response.raise_for_status()
|
43 |
-
questions_data = response.json()
|
44 |
if not questions_data:
|
45 |
yield "Fetched questions list is empty or invalid format.", None, log_output
|
46 |
return
|
@@ -68,7 +68,6 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
68 |
"FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. "
|
69 |
"If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. "
|
70 |
"If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. "
|
71 |
-
"If the answer is that no such event or person exists, respond with the single word 'none' or 'no one' as appropriate. Avoid long explanations."
|
72 |
"ALWAYS answer with the least amount of words (single word wherever possible). If the answer is 'right', say 'right, and not 'the answer is right'"
|
73 |
"Only respond with your final answer using the format: FINAL ANSWER: [your answer]. Do not include reasoning, context, explanations, markdown, or additional sections."
|
74 |
"Do not provide short answers and detailed answers seperately. You ONLY have to answer with the shortest answer possible. We DO NOT need explanations. Also dont use 'task outcome:'"
|
@@ -76,6 +75,7 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
76 |
"You are a precise and concise AI assistant competing in a strict evaluation benchmark. You will be asked a question. You must only output a single final answer, using the following format exactly: FINAL ANSWER: [your answer]"
|
77 |
"Guidelines: Do NOT explain your reasoning. Do NOT output markdown, sections, titles, bullet points, or formatting like (Task outcome), (Detailed version), or (Additional context). Do NOT include references, sources, or citations. Do NOT include any leading text like (Here is the final answer), (The correct answer is), or (Answer):. Do NOT repeat the question or summarize it."
|
78 |
"Your response must consist of a single line starting with: FINAL ANSWER: and nothing else."
|
|
|
79 |
"Normalization rules: If the answer is a list, apply the above rules to each item, and separate them with commas. If the answer is a number, write it as digits (no commas, no units unless asked). If the answer is a string, use lowercase, no articles (a, an, the), and no abbreviations."
|
80 |
"If there is no correct answer (e.g., no such person, place, or event), respond with: FINAL ANSWER: none"
|
81 |
)
|
|
|
26 |
model_id="gpt-4o", # ✅ valid OpenAI model name
|
27 |
api_key=os.environ["OPENAI_API_KEY"] # ✅ securely load from environment
|
28 |
),
|
29 |
+
max_steps=10,
|
30 |
verbosity_level=2
|
31 |
)
|
32 |
except Exception as e:
|
|
|
40 |
try:
|
41 |
response = requests.get(questions_url, timeout=15)
|
42 |
response.raise_for_status()
|
43 |
+
questions_data = response.json()
|
44 |
if not questions_data:
|
45 |
yield "Fetched questions list is empty or invalid format.", None, log_output
|
46 |
return
|
|
|
68 |
"FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. "
|
69 |
"If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. "
|
70 |
"If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. "
|
|
|
71 |
"ALWAYS answer with the least amount of words (single word wherever possible). If the answer is 'right', say 'right, and not 'the answer is right'"
|
72 |
"Only respond with your final answer using the format: FINAL ANSWER: [your answer]. Do not include reasoning, context, explanations, markdown, or additional sections."
|
73 |
"Do not provide short answers and detailed answers seperately. You ONLY have to answer with the shortest answer possible. We DO NOT need explanations. Also dont use 'task outcome:'"
|
|
|
75 |
"You are a precise and concise AI assistant competing in a strict evaluation benchmark. You will be asked a question. You must only output a single final answer, using the following format exactly: FINAL ANSWER: [your answer]"
|
76 |
"Guidelines: Do NOT explain your reasoning. Do NOT output markdown, sections, titles, bullet points, or formatting like (Task outcome), (Detailed version), or (Additional context). Do NOT include references, sources, or citations. Do NOT include any leading text like (Here is the final answer), (The correct answer is), or (Answer):. Do NOT repeat the question or summarize it."
|
77 |
"Your response must consist of a single line starting with: FINAL ANSWER: and nothing else."
|
78 |
+
"Search the web as much as you want to reach the final answer. In the end choose the best answer after giving it careful thought"
|
79 |
"Normalization rules: If the answer is a list, apply the above rules to each item, and separate them with commas. If the answer is a number, write it as digits (no commas, no units unless asked). If the answer is a string, use lowercase, no articles (a, an, the), and no abbreviations."
|
80 |
"If there is no correct answer (e.g., no such person, place, or event), respond with: FINAL ANSWER: none"
|
81 |
)
|