Spaces:
Runtime error
Runtime error
Update app.py
Browse files12343 unmodified lines89101112131438 unmodified lines5354555657585960616263646566676869702 unmodified lines73747576777879from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,toolimport datetimeimport requestsimport pytz3 unmodified linesfrom Gradio_UI import GradioUIddg = DuckDuckGoSearchTool()# Below is an example of a tool that does nothing. Amaze us with your creativity !@tool38 unmodified linesfinal_answer = FinalAnswerTool()# 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:# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'model = HfApiModel(max_tokens=2096,temperature=0.5,model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloadedcustom_role_conversions=None,)# Import tool from Hubimage_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)2 unmodified linesagent = CodeAgent(model=model,tools=[find_similar_songs, get_current_time_in_timezone, final_answer], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,12343 unmodified lines89101112131438 unmodified lines535455565758596061626364656667686970717273747576772 unmodified lines80818283848586from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool, LiteLLMModelimport datetimeimport requestsimport pytz3 unmodified linesfrom Gradio_UI import GradioUI# Below is an example of a tool that does nothing. Amaze us with your creativity !@tool38 unmodified linesfinal_answer = FinalAnswerTool()ddg = DuckDuckGoSearchTool()# 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:# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'# model = HfApiModel(# max_tokens=2096,# temperature=0.5,# model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded# custom_role_conversions=None,# )model = LiteLLMModel(model_id="ollama_chat/qwen2.5:7b", # Ollama model identifierapi_base="http://127.0.0.1:11434", # default Ollama HTTP portnum_ctx=8192,temperature=0.5)# Import tool from Hubimage_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)2 unmodified linesagent = CodeAgent(model=model,tools=[find_similar_songs, get_current_time_in_timezone, final_answer, ddg], ## add your tools here (don't remove final answer)max_steps=6,verbosity_level=1,grammar=None,
app.py+16-9