Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,14 +50,14 @@ class BasicAgent:
|
|
| 50 |
if self.cfg["provider"] == "hf":
|
| 51 |
try:
|
| 52 |
# Try text-generation first
|
| 53 |
-
out = self.
|
| 54 |
model=model, prompt=prompt, max_new_tokens=128, temperature=0.2
|
| 55 |
)
|
| 56 |
return out.strip()
|
| 57 |
except Exception as e:
|
| 58 |
# If the backend says “Supported task: conversational”, retry with chat
|
| 59 |
if "supported task: conversational" in str(e).lower():
|
| 60 |
-
chat = self.
|
| 61 |
model=model,
|
| 62 |
messages=[{"role": "user", "content": prompt}],
|
| 63 |
max_tokens=128,
|
|
|
|
| 50 |
if self.cfg["provider"] == "hf":
|
| 51 |
try:
|
| 52 |
# Try text-generation first
|
| 53 |
+
out = self.hf.text_generation(
|
| 54 |
model=model, prompt=prompt, max_new_tokens=128, temperature=0.2
|
| 55 |
)
|
| 56 |
return out.strip()
|
| 57 |
except Exception as e:
|
| 58 |
# If the backend says “Supported task: conversational”, retry with chat
|
| 59 |
if "supported task: conversational" in str(e).lower():
|
| 60 |
+
chat = self.hf.chat_completion(
|
| 61 |
model=model,
|
| 62 |
messages=[{"role": "user", "content": prompt}],
|
| 63 |
max_tokens=128,
|