wlchee commited on
Commit
557287d
·
verified ·
1 Parent(s): 8129655

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -4,7 +4,8 @@ import requests
4
  import pandas as pd
5
  from datetime import datetime
6
  import random
7
- from smolagents import Tool, HfAgent
 
8
 
9
  # --- Enhanced Agent Definition ---
10
  class EnhancedAgent:
@@ -54,12 +55,8 @@ class EnhancedAgent:
54
 
55
  # Fallback to HF Agent for complex questions
56
  try:
57
- agent = HfAgent(
58
- "bigcode/starcoder",
59
- max_new_tokens=150,
60
- temperature=0.5
61
- )
62
- return agent.run(question)
63
  except Exception as e:
64
  print(f"Agent error: {e}")
65
  return "I couldn't find an answer to that question."
 
4
  import pandas as pd
5
  from datetime import datetime
6
  import random
7
+ from transformers import Tool
8
+ from transformers.agents import Agent
9
 
10
  # --- Enhanced Agent Definition ---
11
  class EnhancedAgent:
 
55
 
56
  # Fallback to HF Agent for complex questions
57
  try:
58
+ agent = Agent("bigcode/starcoder")
59
+ return agent.run(question, remote=True)
 
 
 
 
60
  except Exception as e:
61
  print(f"Agent error: {e}")
62
  return "I couldn't find an answer to that question."