Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import os
|
|
| 5 |
from getpass import getpass
|
| 6 |
|
| 7 |
|
| 8 |
-
os.environ["HUGGINGFACEHUB_API_TOKEN"] = getpass()
|
| 9 |
|
| 10 |
from langchain.embeddings import OpenAIEmbeddings, HuggingFaceInstructEmbeddings
|
| 11 |
from langchain.vectorstores import FAISS
|
|
@@ -47,7 +47,7 @@ def get_vectorstore(text_chunks):
|
|
| 47 |
def get_conversation_chain(vectorstore):
|
| 48 |
# llm = ChatOpenAI()
|
| 49 |
# , token=HUGGINGFACEHUB_API_TOKEN
|
| 50 |
-
llm = HuggingFaceHub(repo_id="google/flan-t5-xxl", model_kwargs={"temperature":0.5, "max_length":512}
|
| 51 |
|
| 52 |
memory = ConversationBufferMemory(
|
| 53 |
memory_key='chat_history', return_messages=True)
|
|
|
|
| 5 |
from getpass import getpass
|
| 6 |
|
| 7 |
|
| 8 |
+
# os.environ["HUGGINGFACEHUB_API_TOKEN"] = getpass()
|
| 9 |
|
| 10 |
from langchain.embeddings import OpenAIEmbeddings, HuggingFaceInstructEmbeddings
|
| 11 |
from langchain.vectorstores import FAISS
|
|
|
|
| 47 |
def get_conversation_chain(vectorstore):
|
| 48 |
# llm = ChatOpenAI()
|
| 49 |
# , token=HUGGINGFACEHUB_API_TOKEN
|
| 50 |
+
llm = HuggingFaceHub(repo_id="google/flan-t5-xxl", model_kwargs={"temperature":0.5, "max_length":512})
|
| 51 |
|
| 52 |
memory = ConversationBufferMemory(
|
| 53 |
memory_key='chat_history', return_messages=True)
|