Update app.py
Browse files
app.py
CHANGED
|
@@ -18,13 +18,12 @@ class BasicAgent:
|
|
| 18 |
# initialize HF inference pipeline once
|
| 19 |
if HF_TOKEN is None:
|
| 20 |
raise ValueError("HF_TOKEN not set in environment")
|
| 21 |
-
self.generator = pipeline("text-generation", model="
|
| 22 |
# The GAIA system prompt (no "FINAL ANSWER:" at the end)
|
| 23 |
self.system_prompt = (
|
| 24 |
-
"You are a
|
| 25 |
-
"
|
| 26 |
-
"
|
| 27 |
-
"with no extra commentary, prefixes, or units.\n\n"
|
| 28 |
)
|
| 29 |
print("BasicAgent initialized with LLM.")
|
| 30 |
|
|
@@ -34,7 +33,7 @@ class BasicAgent:
|
|
| 34 |
# Run the model
|
| 35 |
out = self.generator(
|
| 36 |
prompt,
|
| 37 |
-
max_new_tokens=
|
| 38 |
return_full_text=False
|
| 39 |
)
|
| 40 |
answer = out[0]["generated_text"].strip()
|
|
|
|
| 18 |
# initialize HF inference pipeline once
|
| 19 |
if HF_TOKEN is None:
|
| 20 |
raise ValueError("HF_TOKEN not set in environment")
|
| 21 |
+
self.generator = pipeline("text-generation", model="EleutherAI/gpt-neo-125M")
|
| 22 |
# The GAIA system prompt (no "FINAL ANSWER:" at the end)
|
| 23 |
self.system_prompt = (
|
| 24 |
+
"You are a concise AI assistant. "
|
| 25 |
+
"Answer in as few words as possible—a number, a few words, or a comma-separated list. "
|
| 26 |
+
"No commentary, prefixes, or units.\n\n"
|
|
|
|
| 27 |
)
|
| 28 |
print("BasicAgent initialized with LLM.")
|
| 29 |
|
|
|
|
| 33 |
# Run the model
|
| 34 |
out = self.generator(
|
| 35 |
prompt,
|
| 36 |
+
max_new_tokens=16, # leave room for the answer
|
| 37 |
return_full_text=False
|
| 38 |
)
|
| 39 |
answer = out[0]["generated_text"].strip()
|