Spaces:
Sleeping
Sleeping
Update chatbot.py
Browse files- chatbot.py +5 -5
chatbot.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
|
2 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
3 |
-
from
|
4 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
5 |
from langchain_community.vectorstores import Chroma
|
6 |
from langchain_core.prompts import ChatPromptTemplate
|
@@ -44,10 +44,10 @@ def create_chain(chains, pdf_doc):
|
|
44 |
|
45 |
def create_model():
|
46 |
|
47 |
-
llm =
|
48 |
-
repo_id="
|
49 |
-
temperature=1.0,
|
50 |
-
|
51 |
)
|
52 |
return llm
|
53 |
|
|
|
1 |
|
2 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
3 |
+
from langchain_huggingface.llms import HuggingFaceLLM
|
4 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
5 |
from langchain_community.vectorstores import Chroma
|
6 |
from langchain_core.prompts import ChatPromptTemplate
|
|
|
44 |
|
45 |
def create_model():
|
46 |
|
47 |
+
llm = HuggingFaceLLM.from_pretrained(
|
48 |
+
repo_id="google/flan-t5-base",
|
49 |
+
temperature=1.0,
|
50 |
+
max_new_tokens=250
|
51 |
)
|
52 |
return llm
|
53 |
|