Facelook commited on
Commit
c3e5ee5
·
1 Parent(s): d82da21

Added instruction.

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -26,7 +26,8 @@ class BasicAgent:
26
  try:
27
  # Generate response
28
  print("Using Inference API for generation...")
29
- response = self.client.text_generation(question)
 
30
  answer = response
31
  print(f"Agent generated response (first 50 chars): {answer[:50]}...")
32
  return answer
@@ -105,6 +106,8 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
105
  print(f"Error running agent on task {task_id}: {e}")
106
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
107
 
 
 
108
  if not answers_payload:
109
  print("Agent did not produce any answers to submit.")
110
  return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
@@ -160,7 +163,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
160
 
161
  # --- Build Gradio Interface using Blocks ---
162
  with gr.Blocks() as demo:
163
- gr.Markdown("# Basic Agent Evaluation Runner #14")
164
  gr.Markdown(
165
  """
166
  **Instructions:**
 
26
  try:
27
  # Generate response
28
  print("Using Inference API for generation...")
29
+ prompt = f"""<s>[INST] Answer the following question directly without any explanations, introductions, or conclusions. Just provide the answer itself: {question} [/INST]</s>"""
30
+ response = self.client.text_generation(prompt, max_new_tokens=512, do_sample=True, temperature=0.1)
31
  answer = response
32
  print(f"Agent generated response (first 50 chars): {answer[:50]}...")
33
  return answer
 
106
  print(f"Error running agent on task {task_id}: {e}")
107
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
108
 
109
+ break # Test one question only first
110
+
111
  if not answers_payload:
112
  print("Agent did not produce any answers to submit.")
113
  return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
 
163
 
164
  # --- Build Gradio Interface using Blocks ---
165
  with gr.Blocks() as demo:
166
+ gr.Markdown("# Basic Agent Evaluation Runner #15")
167
  gr.Markdown(
168
  """
169
  **Instructions:**