Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from langchain.llms import OpenAI
|
|
10 |
llm = OpenAI(openai_api_key="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", model_name="gpt-3.5-turbo-instruct")
|
11 |
openai_embeddings = OpenAIEmbeddings(openai_api_key='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')
|
12 |
db = FAISS.load_local("faiss_index",openai_embeddings, allow_dangerous_deserialization=True)
|
13 |
-
|
14 |
template = """
|
15 |
Answer the question based on the context below. If you can't
|
16 |
answer the question, answer with "I don't know".
|
|
|
10 |
llm = OpenAI(openai_api_key="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", model_name="gpt-3.5-turbo-instruct")
|
11 |
openai_embeddings = OpenAIEmbeddings(openai_api_key='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')
|
12 |
db = FAISS.load_local("faiss_index",openai_embeddings, allow_dangerous_deserialization=True)
|
13 |
+
parser = StrOutputParser()
|
14 |
template = """
|
15 |
Answer the question based on the context below. If you can't
|
16 |
answer the question, answer with "I don't know".
|