Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -66,15 +66,14 @@ def main():
|
|
66 |
#llm = AutoModelForCausalLM.from_pretrained("CohereForAI/aya-101")
|
67 |
# llm = AutoModelForCausalLM.from_pretrained(PATH,local_files_only=True)
|
68 |
llm = huggingface_hub.HuggingFaceHub(repo_id="google/flan-t5-small",
|
69 |
-
model_kwargs={"temperature":1.0, "max_length":
|
70 |
docs = vector_store.similarity_search(query=query, k=3)
|
71 |
global chain
|
72 |
-
chain = load_qa_chain(llm=llm, chain_type="stuff")
|
73 |
-
response = chain.run(input_documents=docs, question=query)
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
#response = chain.run(chain)
|
78 |
st.write(response)
|
79 |
|
80 |
|
|
|
66 |
#llm = AutoModelForCausalLM.from_pretrained("CohereForAI/aya-101")
|
67 |
# llm = AutoModelForCausalLM.from_pretrained(PATH,local_files_only=True)
|
68 |
llm = huggingface_hub.HuggingFaceHub(repo_id="google/flan-t5-small",
|
69 |
+
model_kwargs={"temperature":1.0, "max_length":256})
|
70 |
docs = vector_store.similarity_search(query=query, k=3)
|
71 |
global chain
|
72 |
+
#chain = load_qa_chain(llm=llm, chain_type="stuff")
|
73 |
+
#response = chain.run(input_documents=docs, question=query)
|
74 |
+
retriever=vector_store.as_retriever()
|
75 |
+
chain = RetrievalQA.from_chain_type(llm=llm,chain_type="stuff",retriever=retriever)
|
76 |
+
response = chain.run(chain)
|
|
|
77 |
st.write(response)
|
78 |
|
79 |
|