Spaces:
Sleeping
Sleeping
Update init_agent.py
Browse files- init_agent.py +4 -2
init_agent.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
from transformers import pipeline
|
| 3 |
-
|
| 4 |
from typing import Annotated, TypedDict, Optional, Any
|
| 5 |
from langgraph.graph import StateGraph, START, END
|
| 6 |
from langgraph.graph.message import add_messages
|
|
@@ -11,7 +11,9 @@ from langchain_community.tools import DuckDuckGoSearchRun
|
|
| 11 |
|
| 12 |
from langchain_core.tools import Tool
|
| 13 |
|
| 14 |
-
hf_token = os.environ.
|
|
|
|
|
|
|
| 15 |
|
| 16 |
def init_classifier():
|
| 17 |
classifier = pipeline("zero-shot-classification", model='cross-encoder/nli-distilroberta-base')
|
|
|
|
| 1 |
import os
|
| 2 |
from transformers import pipeline
|
| 3 |
+
from huggingface_hub import login
|
| 4 |
from typing import Annotated, TypedDict, Optional, Any
|
| 5 |
from langgraph.graph import StateGraph, START, END
|
| 6 |
from langgraph.graph.message import add_messages
|
|
|
|
| 11 |
|
| 12 |
from langchain_core.tools import Tool
|
| 13 |
|
| 14 |
+
hf_token = os.environ.get('HF_TOKEN')
|
| 15 |
+
if hf_token:
|
| 16 |
+
login(token=hf_token)
|
| 17 |
|
| 18 |
def init_classifier():
|
| 19 |
classifier = pipeline("zero-shot-classification", model='cross-encoder/nli-distilroberta-base')
|