Spaces:
Running
Running
import yaml | |
import os | |
from smolagents import GradioUI, CodeAgent, HfApiModel | |
# Get current directory path | |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) | |
from tools.final_answer import FinalAnswerTool as FinalAnswer | |
from managed_agents.web_agent.app import agent_web_agent | |
from managed_agents.useless.app import agent_useless | |
model = HfApiModel( | |
max_tokens=2096, | |
temperature=0.5, | |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct', | |
provider=None, | |
) | |
final_answer = FinalAnswer() | |
with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream: | |
prompt_templates = yaml.safe_load(stream) | |
agent = CodeAgent( | |
model=model, | |
tools=[], | |
managed_agents=[agent_web_agent, agent_useless], | |
max_steps=6, | |
verbosity_level=-1, | |
grammar=None, | |
planning_interval=None, | |
name=None, | |
description=None, | |
prompt_templates=prompt_templates | |
) | |
if __name__ == "__main__": | |
GradioUI(agent).launch() | |