Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,10 @@
|
|
| 1 |
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
|
|
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
|
|
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
|
@@ -19,12 +21,13 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 19 |
return "What magic will you build ?"
|
| 20 |
|
| 21 |
@tool
|
| 22 |
-
def calculate_bandwidth(users: int, usage:
|
| 23 |
"""
|
| 24 |
Calculate the recommended internet speed based on user inputs.
|
| 25 |
-
|
| 26 |
:param users: The total number of users requiring internet access.
|
| 27 |
-
:param usage: A dictionary with usage categories as keys
|
|
|
|
| 28 |
:return: Recommended bandwidth in Mbps to ensure smooth performance.
|
| 29 |
"""
|
| 30 |
usage_requirements = {
|
|
@@ -43,7 +46,7 @@ def calculate_bandwidth(users: int, usage: dict) -> float:
|
|
| 43 |
|
| 44 |
|
| 45 |
final_answer = FinalAnswerTool()
|
| 46 |
-
duck_duck_go_search = DuckDuckGoSearchTool()
|
| 47 |
|
| 48 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 49 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
|
| 1 |
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
| 2 |
+
from typing import Dict
|
| 3 |
import datetime
|
| 4 |
import requests
|
| 5 |
import pytz
|
| 6 |
import yaml
|
| 7 |
+
from transformers import HfApiModel
|
| 8 |
from tools.final_answer import FinalAnswerTool
|
| 9 |
|
| 10 |
from Gradio_UI import GradioUI
|
|
|
|
| 21 |
return "What magic will you build ?"
|
| 22 |
|
| 23 |
@tool
|
| 24 |
+
def calculate_bandwidth(users: int, usage: Dict[str, int]) -> float:
|
| 25 |
"""
|
| 26 |
Calculate the recommended internet speed based on user inputs.
|
| 27 |
+
|
| 28 |
:param users: The total number of users requiring internet access.
|
| 29 |
+
:param usage: A dictionary with usage categories as keys (one of "browsing", "video_call", "hd_streaming",
|
| 30 |
+
"4k_streaming", "gaming", "remote_work") and the number of users per category as values.
|
| 31 |
:return: Recommended bandwidth in Mbps to ensure smooth performance.
|
| 32 |
"""
|
| 33 |
usage_requirements = {
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
final_answer = FinalAnswerTool()
|
| 49 |
+
#duck_duck_go_search = DuckDuckGoSearchTool()
|
| 50 |
|
| 51 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 52 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|