Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ from smolagents import HfApiModel
|
|
| 3 |
from smolagents import tool
|
| 4 |
#from smolagents import DuckDuckGoSearchTool
|
| 5 |
import os
|
| 6 |
-
|
| 7 |
from datasets import load_dataset
|
| 8 |
dataset = load_dataset("bprateek/amazon_product_description", revision="main", split="train", token=os.getenv('Testing'))
|
| 9 |
|
|
@@ -24,9 +24,12 @@ def get_price_tool(arg1:str)-> float: #it's import to specify the return type
|
|
| 24 |
|
| 25 |
#Agent Example
|
| 26 |
model = HfApiModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", token=os.getenv('Testing'))
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
#agent.run("Can you dispay prices of all Electronics products in a table")
|
| 29 |
-
GradioUI(agent).launch()
|
| 30 |
|
| 31 |
# Access HF Hub
|
| 32 |
#from huggingface_hub import list_models
|
|
|
|
| 3 |
from smolagents import tool
|
| 4 |
#from smolagents import DuckDuckGoSearchTool
|
| 5 |
import os
|
| 6 |
+
import gradio as gr
|
| 7 |
from datasets import load_dataset
|
| 8 |
dataset = load_dataset("bprateek/amazon_product_description", revision="main", split="train", token=os.getenv('Testing'))
|
| 9 |
|
|
|
|
| 24 |
|
| 25 |
#Agent Example
|
| 26 |
model = HfApiModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", token=os.getenv('Testing'))
|
| 27 |
+
demo = gr.Interface(fn=CodeAgent(tools=[get_price_tool], model=model), inputs="textbox", outputs="textbox")
|
| 28 |
+
|
| 29 |
+
if __name__ == "__main__":
|
| 30 |
+
demo.launch()
|
| 31 |
+
|
| 32 |
#agent.run("Can you dispay prices of all Electronics products in a table")
|
|
|
|
| 33 |
|
| 34 |
# Access HF Hub
|
| 35 |
#from huggingface_hub import list_models
|