sarath2803 commited on
Commit
c4b92f5
·
verified ·
1 Parent(s): 7d69add

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from smolagents import CodeAgent, tool
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
  from bs4 import BeautifulSoup
4
  import requests
@@ -63,7 +63,7 @@ You are a mobile phone expert. Use the tools and return the best phone based on
63
  tokenizer = AutoTokenizer.from_pretrained(model_id)
64
  model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
65
 
66
- self.agent = CodeAgent(
67
  tools=[scrape_phones, compare_phones],
68
  model=model,
69
  system_prompt=self.system_prompt
 
1
+ from smolagents import ToolCallingAgent, tool
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
  from bs4 import BeautifulSoup
4
  import requests
 
63
  tokenizer = AutoTokenizer.from_pretrained(model_id)
64
  model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
65
 
66
+ self.agent = ToolCallingAgent(
67
  tools=[scrape_phones, compare_phones],
68
  model=model,
69
  system_prompt=self.system_prompt