Spaces:
Runtime error
Runtime error
Update agent.py
Browse files
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
|
468 |
-
llm =
|
469 |
-
|
470 |
-
|
471 |
-
|
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 |
|