Freddolin commited on
Commit
b5d03d2
·
verified ·
1 Parent(s): f757e9a

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +4 -2
agent.py CHANGED
@@ -10,12 +10,12 @@ If you are asked for a comma separated list, apply the above rules depending of
10
  """
11
 
12
  class GaiaAgent:
13
- def __init__(self, model_id="HuggingFaceH4/zephyr-7b-beta"):
14
  self.generator = pipeline("text-generation", model=model_id, tokenizer=model_id, max_new_tokens=512)
15
 
16
  def __call__(self, question: str) -> tuple[str, str]:
17
  try:
18
- prompt = f"<|system|>\n{SYSTEM_PROMPT}\n<|user|>\n{question}\n<|assistant|>"
19
  output = self.generator(prompt)[0]["generated_text"]
20
 
21
  if "FINAL ANSWER:" in output:
@@ -25,3 +25,5 @@ class GaiaAgent:
25
  return final, output
26
  except Exception as e:
27
  return "ERROR", f"Agent failed: {e}"
 
 
 
10
  """
11
 
12
  class GaiaAgent:
13
+ def __init__(self, model_id="tiiuae/falcon-rw-1b"):
14
  self.generator = pipeline("text-generation", model=model_id, tokenizer=model_id, max_new_tokens=512)
15
 
16
  def __call__(self, question: str) -> tuple[str, str]:
17
  try:
18
+ prompt = f"{SYSTEM_PROMPT}\n\n{question}\nFINAL ANSWER:"
19
  output = self.generator(prompt)[0]["generated_text"]
20
 
21
  if "FINAL ANSWER:" in output:
 
25
  return final, output
26
  except Exception as e:
27
  return "ERROR", f"Agent failed: {e}"
28
+
29
+