Update agents/agents_nodes.py
Browse files- agents/agents_nodes.py +3 -2
agents/agents_nodes.py
CHANGED
|
@@ -2,7 +2,7 @@ import json
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import torch
|
| 4 |
from langchain_core.messages import AIMessage, ToolMessage
|
| 5 |
-
from langchain_huggingface import HuggingFacePipeline
|
| 6 |
from langchain_core.runnables import RunnableLambda
|
| 7 |
from langgraph.prebuilt import ToolNode
|
| 8 |
from utils.state_utils import AgentState
|
|
@@ -25,7 +25,8 @@ text_generator = pipeline(
|
|
| 25 |
)
|
| 26 |
|
| 27 |
|
| 28 |
-
llm = HuggingFacePipeline(pipeline=text_generator)
|
|
|
|
| 29 |
|
| 30 |
llm_instantiated = llm.bind_tools(
|
| 31 |
[time_value_tool],
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import torch
|
| 4 |
from langchain_core.messages import AIMessage, ToolMessage
|
| 5 |
+
from langchain_huggingface import HuggingFacePipeline, ChatHuggingFace
|
| 6 |
from langchain_core.runnables import RunnableLambda
|
| 7 |
from langgraph.prebuilt import ToolNode
|
| 8 |
from utils.state_utils import AgentState
|
|
|
|
| 25 |
)
|
| 26 |
|
| 27 |
|
| 28 |
+
# llm = HuggingFacePipeline(pipeline=text_generator)
|
| 29 |
+
llm =ChatHuggingFace(llm=text_generator)
|
| 30 |
|
| 31 |
llm_instantiated = llm.bind_tools(
|
| 32 |
[time_value_tool],
|