Spaces:
Runtime error
Runtime error
ryanrwatkins
commited on
Commit
Β·
7948755
1
Parent(s):
6b31d07
Create notes.md
Browse files
notes.md
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
with open("foo.pkl", 'rb') as f:
|
2 |
+
new_docsearch = pickle.load(f)
|
3 |
+
|
4 |
+
docsearch = FAISS.from_texts(texts, new_docsearch)
|
5 |
+
query = "I am student and I want to know what statistical tests were used in the study, which results were statistically significant, and how could I use this when teaching biology"
|
6 |
+
docs = docsearch.similarity_search(query)
|
7 |
+
#print(docs[0].page_content)
|
8 |
+
from langchain.chains.question_answering import load_qa_chain
|
9 |
+
from langchain.llms import OpenAI
|
10 |
+
chain = load_qa_chain(OpenAI(temperature=1.2), chain_type="stuff")
|
11 |
+
resp = chain.run(input_documents=docs, question=query)
|
12 |
+
print(resp)
|