Spaces:
Running
Running
hf
Browse files
app.py
CHANGED
@@ -10,7 +10,8 @@ from langchain.docstore.document import Document
|
|
10 |
from langchain_community.retrievers import BM25Retriever
|
11 |
from retriever import extract_text
|
12 |
|
13 |
-
|
|
|
14 |
|
15 |
# Load the dataset
|
16 |
guest_dataset = datasets.load_dataset("agents-course/unit3-invitees", split="train")
|
@@ -41,7 +42,7 @@ llm = HuggingFaceEndpoint(
|
|
41 |
repetition_penalty=1.03,
|
42 |
)
|
43 |
|
44 |
-
model = ChatHuggingFace(llm=llm)
|
45 |
|
46 |
def predict(message, history):
|
47 |
history_langchain_format = []
|
|
|
10 |
from langchain_community.retrievers import BM25Retriever
|
11 |
from retriever import extract_text
|
12 |
|
13 |
+
HUGGINGFACEHUB_API_TOKEN = os.environ["HUGGINGFACEHUB_API_TOKEN"]
|
14 |
+
login(token=HUGGINGFACEHUB_API_TOKEN)
|
15 |
|
16 |
# Load the dataset
|
17 |
guest_dataset = datasets.load_dataset("agents-course/unit3-invitees", split="train")
|
|
|
42 |
repetition_penalty=1.03,
|
43 |
)
|
44 |
|
45 |
+
model = ChatHuggingFace(llm=llm, verbose=True)
|
46 |
|
47 |
def predict(message, history):
|
48 |
history_langchain_format = []
|