wt002 commited on
Commit
8dfe53b
·
verified ·
1 Parent(s): 40e150a

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +6 -9
agent.py CHANGED
@@ -53,6 +53,7 @@ from langchain.prompts import PromptTemplate
53
  from langchain.chains import LLMChain
54
  from langchain.agents import initialize_agent, Tool, AgentType
55
  from transformers import pipeline
 
56
 
57
  load_dotenv()
58
 
@@ -461,16 +462,12 @@ tools = [wiki_tool, calc_tool, file_tool, web_tool, arvix_tool, youtube_tool, vi
461
  # Get the Hugging Face API token from the environment variable
462
  hf_token = os.getenv("HF_TOKEN")
463
 
464
- # Load the Qwen2.5-Coder-32B-Instruct model using HuggingFaceHub
465
- from langchain_huggingface import HuggingFaceEndpoint
466
 
467
- # Initialize the HuggingFaceEndpoint with the desired model and parameters
468
- llm = HuggingFaceEndpoint(
469
- repo_id="Qwen/Qwen2.5-Coder-32B-Instruct",
470
- #task="conversational",
471
- huggingfacehub_api_token=hf_token,
472
- temperature=0.7,
473
- max_new_tokens=1024
474
  )
475
 
476
 
 
53
  from langchain.chains import LLMChain
54
  from langchain.agents import initialize_agent, Tool, AgentType
55
  from transformers import pipeline
56
+ from smolagents import LiteLLMModel
57
 
58
  load_dotenv()
59
 
 
462
  # Get the Hugging Face API token from the environment variable
463
  hf_token = os.getenv("HF_TOKEN")
464
 
 
 
465
 
466
+ # Initialize the desired model and parameters
467
+ llm = LiteLLMModel(
468
+ model_id="gemini/gemini-2.0-flash",
469
+ api_key=os.getenv("GEMINI_API_KEY"),
470
+ max_tokens=8192
 
 
471
  )
472
 
473