wt002 commited on
Commit
368a05d
·
verified ·
1 Parent(s): b31aeee

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +1 -11
agent.py CHANGED
@@ -467,7 +467,7 @@ hf_token = os.getenv("HF_TOKEN")
467
  from langchain_huggingface import HuggingFaceEndpoint
468
 
469
  # Initialize the HuggingFaceEndpoint with the desired model and parameters
470
- qwen_model = HuggingFaceEndpoint(
471
  repo_id="Qwen/Qwen2.5-Coder-32B-Instruct",
472
  task="text-generation",
473
  huggingfacehub_api_token=os.getenv("HF_TOKEN"),
@@ -476,15 +476,6 @@ qwen_model = HuggingFaceEndpoint(
476
  )
477
 
478
  # Initialize the LangChain agent with the tool(s) and the model
479
- agent = initialize_agent(
480
- tools=tools,
481
- llm=qwen_model,
482
- agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
483
- verbose=True
484
- )
485
-
486
-
487
- # Create an agent using the planner, task classifier, and decision logic
488
  agent = initialize_agent(
489
  tools=tools,
490
  llm=llm,
@@ -494,7 +485,6 @@ agent = initialize_agent(
494
 
495
 
496
 
497
-
498
  # -------------------------------
499
  # Step 8: Use the Planner, Classifier, and Decision Logic
500
  # -------------------------------
 
467
  from langchain_huggingface import HuggingFaceEndpoint
468
 
469
  # Initialize the HuggingFaceEndpoint with the desired model and parameters
470
+ llm = HuggingFaceEndpoint(
471
  repo_id="Qwen/Qwen2.5-Coder-32B-Instruct",
472
  task="text-generation",
473
  huggingfacehub_api_token=os.getenv("HF_TOKEN"),
 
476
  )
477
 
478
  # Initialize the LangChain agent with the tool(s) and the model
 
 
 
 
 
 
 
 
 
479
  agent = initialize_agent(
480
  tools=tools,
481
  llm=llm,
 
485
 
486
 
487
 
 
488
  # -------------------------------
489
  # Step 8: Use the Planner, Classifier, and Decision Logic
490
  # -------------------------------