cloud-sean commited on
Commit
c9e148e
·
1 Parent(s): 5f28c0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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://cog-mnjbf5r4o6b3e.openai.azure.com/"
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="chat"), 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)
 
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)