Spaces:
Runtime error
Runtime error
File size: 944 Bytes
afb4e60 f098479 afb4e60 96d26e4 afb4e60 024fcea de76b1c 024fcea afb4e60 f098479 f498f86 afb4e60 f098479 afb4e60 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # agent_core.py
from smolagents import CodeAgent, HfApiModel
from tools import DuckDuckGoSearchTool, WeatherInfoTool, HubStatsTool
from retriever import load_guest_dataset
# Initialize model
model = HfApiModel(
max_tokens=2096,
temperature=0.5,
#model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
#model_id='meta-llama/Llama-3.2-3B-Instruct',# it is possible that this model may be overloaded
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
custom_role_conversions=None,
)
# Initialize tools
search_tool = DuckDuckGoSearchTool()
weather_info_tool = WeatherInfoTool()
hub_stats_tool = HubStatsTool()
guest_info_tool = load_guest_dataset()
# Initialize Agent (a.k.a. Alfred)
alfred = CodeAgent(
tools=[guest_info_tool, weather_info_tool, hub_stats_tool, search_tool],
model=model,
add_base_tools=True,
planning_interval=3
)
|