CoolFace
Apppublic

AMdevIA/HFlearningPathAgent

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
app.py41 linesDownload Raw Back to root
1import yaml2import os3from smolagents import GradioUI, CodeAgent, HfApiModel4 5# Get current directory path6CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))7 8from tools.search_hf_ressources import SearchHfRessourcesTool9from tools.generate_learning_path import GenerateLearningPathTool10from tools.final_answer import FinalAnswerTool11 12 13 14model = HfApiModel(15model_id='Qwen/Qwen2.5-Coder-32B-Instruct',16provider=None,17)18 19search_hf_ressources = SearchHfRessourcesTool()20generate_learning_path = GenerateLearningPathTool()21final_answer = FinalAnswerTool()22 23 24with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream:25    prompt_templates = yaml.safe_load(stream)26 27agent = CodeAgent(28    model=model,29    tools=[search_hf_ressources, generate_learning_path, final_answer],30    managed_agents=[],31    max_steps=10,32    verbosity_level=2,33    grammar=None,34    planning_interval=None,35    name="Guido",36    description=None,37    prompt_templates=prompt_templates38)39if __name__ == "__main__":40    GradioUI(agent).launch()41