olcapone commited on
Commit
c97380d
·
verified ·
1 Parent(s): dc6d7f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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.client.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.client.chat_completion(
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,