| from smolagents import CodeAgent, HfApiModel, LiteLLMModel | |
| import numpy as np | |
| import time | |
| import datetime | |
| model = LiteLLMModel( | |
| model_id="ollama_chat/qwen2:7b", # Or try other Ollama-supported models | |
| api_base="http://127.0.0.1:11434", # Default Ollama local server | |
| num_ctx=8192, | |
| ) | |
| agent = CodeAgent(tools=[], model=model, additional_authorized_imports=['datetime']) | |
| # agent.run( | |
| # """ | |
| # Alfred needs to prepare for the party. Here are the tasks: | |
| # 1. Prepare the drinks - 30 minutes | |
| # 2. Decorate the mansion - 60 minutes | |
| # 3. Set up the menu - 45 minutes | |
| # 4. Prepare the music and playlist - 45 minutes | |
| # If we start right now, at what time will the party be ready? | |
| # """ | |
| # ) | |
| agent.push_to_hub("sachinkum0009/AlfredAgent") |