Spaces:
Running
Running
Commit
·
c9e148e
1
Parent(s):
5f28c0b
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ from langchain.chat_models import AzureChatOpenAI
|
|
15 |
|
16 |
os.environ["OPENAI_API_TYPE"] = openai.api_type = "azure"
|
17 |
os.environ["OPENAI_API_VERSION"] = openai.api_version = "2023-03-15-preview"
|
18 |
-
os.environ["OPENAI_API_BASE"] = openai.api_base = "https://
|
19 |
# openai.api_key = os.environ["OPENAI_API_KEY"]
|
20 |
|
21 |
|
@@ -59,7 +59,7 @@ def upload_pdf(file, pdf_text, embeddings, vectorstore, azure_embeddings, qa, pr
|
|
59 |
documents=texts,
|
60 |
embeddings=embeddings,
|
61 |
metadatas=[{"source": "source"} for text in texts])
|
62 |
-
qa = RetrievalQA.from_chain_type(llm= AzureChatOpenAI(model_name='gpt-3.5-turbo', deployment_name="
|
63 |
# qa = RetrievalQA.from_chain_type(llm= AzureChatOpenAI(deployment_name="chat", model_name="gpt-35-turbo"), chain_type="stuff", vectorstore=vectorstore.as_retriever())
|
64 |
|
65 |
return pdf_text, pdf_text, embeddings, vectorstore, azure_embeddings, qa, gr.update(visible=True), gr.update(visible=True), gr.update(visible=False)
|
|
|
15 |
|
16 |
os.environ["OPENAI_API_TYPE"] = openai.api_type = "azure"
|
17 |
os.environ["OPENAI_API_VERSION"] = openai.api_version = "2023-03-15-preview"
|
18 |
+
os.environ["OPENAI_API_BASE"] = openai.api_base = "https://eastus-openai-sean.openai.azure.com/"
|
19 |
# openai.api_key = os.environ["OPENAI_API_KEY"]
|
20 |
|
21 |
|
|
|
59 |
documents=texts,
|
60 |
embeddings=embeddings,
|
61 |
metadatas=[{"source": "source"} for text in texts])
|
62 |
+
qa = RetrievalQA.from_chain_type(llm= AzureChatOpenAI(model_name='gpt-3.5-turbo', deployment_name="gpt-35-turbo"), chain_type="stuff", retriever=vectorstore.as_retriever())
|
63 |
# qa = RetrievalQA.from_chain_type(llm= AzureChatOpenAI(deployment_name="chat", model_name="gpt-35-turbo"), chain_type="stuff", vectorstore=vectorstore.as_retriever())
|
64 |
|
65 |
return pdf_text, pdf_text, embeddings, vectorstore, azure_embeddings, qa, gr.update(visible=True), gr.update(visible=True), gr.update(visible=False)
|