Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,8 +9,7 @@ dataset = load_dataset("bprateek/amazon_product_description", revision="main", s
|
|
| 9 |
|
| 10 |
|
| 11 |
@tool
|
| 12 |
-
def get_price_tool(arg1:str)-> float:
|
| 13 |
-
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
"""This is a tool which look on a dataset and filter for products and their various atteibutes like prices description
|
| 15 |
Args:
|
| 16 |
arg1: the category of product
|
|
@@ -24,16 +23,6 @@ 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 |
-
|
| 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
|
| 36 |
-
|
| 37 |
-
#for model in list_models(limit=10, sort="downloads", direction=-1):
|
| 38 |
-
# print(model.id, model.downloads)
|
| 39 |
|
|
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
@tool
|
| 12 |
+
def get_price_tool(arg1:str)-> float:
|
|
|
|
| 13 |
"""This is a tool which look on a dataset and filter for products and their various atteibutes like prices description
|
| 14 |
Args:
|
| 15 |
arg1: the category of product
|
|
|
|
| 23 |
|
| 24 |
#Agent Example
|
| 25 |
model = HfApiModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", token=os.getenv('Testing'))
|
| 26 |
+
agent = CodeAgent(tools=[get_price_tool], model=model)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
agent.run("Can you dispay prices of all Electronics products in a table")
|