Spaces:
Runtime error
Runtime error
Commit
•
9b71521
1
Parent(s):
d7b6bb8
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from langchain.embeddings import HuggingFaceEmbeddings
|
|
7 |
from langchain.chains.question_answering import load_qa_chain
|
8 |
import gradio as gr
|
9 |
from langchain.embeddings import HuggingFaceEmbeddings
|
10 |
-
|
11 |
|
12 |
|
13 |
|
@@ -33,7 +33,7 @@ def main(doc,prompt):
|
|
33 |
result=submitYourDocument(doc)
|
34 |
embeddings = HuggingFaceEmbeddings()
|
35 |
db = FAISS.from_texts(result, embeddings)
|
36 |
-
llm=HuggingFaceHub(repo_id="google/flan-t5-xxl",model_kwargs={"temperature":1, "max_length":512})
|
37 |
chain=load_qa_chain(llm,chain_type="stuff")
|
38 |
query =prompt
|
39 |
docs = db.similarity_search(query)
|
|
|
7 |
from langchain.chains.question_answering import load_qa_chain
|
8 |
import gradio as gr
|
9 |
from langchain.embeddings import HuggingFaceEmbeddings
|
10 |
+
from langchain import HuggingFaceHub
|
11 |
|
12 |
|
13 |
|
|
|
33 |
result=submitYourDocument(doc)
|
34 |
embeddings = HuggingFaceEmbeddings()
|
35 |
db = FAISS.from_texts(result, embeddings)
|
36 |
+
llm=HuggingFaceHub(repo_id="google/flan-t5-xxl",model_kwargs={"temperature":0.1, "max_length":512})
|
37 |
chain=load_qa_chain(llm,chain_type="stuff")
|
38 |
query =prompt
|
39 |
docs = db.similarity_search(query)
|