Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import
|
| 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 =
|
| 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
|