Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -48,12 +48,9 @@ def main():
|
|
48 |
llm = HuggingFacePipeline(pipeline = pipeline, model_kwargs = {'temperature':0})
|
49 |
embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L6-v2')
|
50 |
vectorstore = FAISS.from_documents(data, embeddings)
|
51 |
-
|
52 |
vectorstore.save_local(DB_FAISS_PATH)
|
53 |
-
|
54 |
-
chain= retrievalQA.from_chain_type(llm=llm, chain_type = "stuff",return_source_documents=True, retriever=vectorstore.as_retriever())
|
55 |
result=chain(query)
|
56 |
-
|
57 |
st.write(result['result'])
|
58 |
|
59 |
if __name__ == '__main__':
|
|
|
48 |
llm = HuggingFacePipeline(pipeline = pipeline, model_kwargs = {'temperature':0})
|
49 |
embeddings = HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L6-v2')
|
50 |
vectorstore = FAISS.from_documents(data, embeddings)
|
|
|
51 |
vectorstore.save_local(DB_FAISS_PATH)
|
52 |
+
chain=retrievalQA.from_chain_type(llm=llm, chain_type = "stuff",return_source_documents=True, retriever=vectorstore.as_retriever())
|
|
|
53 |
result=chain(query)
|
|
|
54 |
st.write(result['result'])
|
55 |
|
56 |
if __name__ == '__main__':
|