Spaces:
Sleeping
Sleeping
using transformer model
Browse files123492 unmodified lines9798991001011021031041052 unmodified lines108109110111112113114from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,toolimport datetimeimport requestsimport pytz92 unmodified lines# model_id='https://wxknx1kg971u7k1n.us-east-1.aws.endpoints.huggingface.cloud',# it is possible that this model may be overloaded# custom_role_conversions=None,# )model = LiteLLMModel(model_id="ollama/qwen2.5-coder:32b")# # Import tool from Hub# image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)2 unmodified linesprompt_templates = yaml.safe_load(stream)agent = CodeAgent(model=model,tools=[final_answer,get_current_time_in_timezone,1234592 unmodified lines98991001011021031041051061071081091101111122 unmodified lines115116117118119120121from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,toolfrom smolagents.models import TransformersModelimport datetimeimport requestsimport pytz92 unmodified lines# model_id='https://wxknx1kg971u7k1n.us-east-1.aws.endpoints.huggingface.cloud',# it is possible that this model may be overloaded# custom_role_conversions=None,# )engine = TransformersModel(model_id="meta-llama/Llama-3.2-3B-Instruct",device_map="cuda", # or "cpu" if you don't have a GPUtrust_remote_code=True, # if your model requires remote code executiontorch_dtype='auto',max_new_tokens=5000,temperature=0.5)# # Import tool from Hub# image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)2 unmodified linesprompt_templates = yaml.safe_load(stream)agent = CodeAgent(model=engine,tools=[final_answer,get_current_time_in_timezone,
app.py+11-4