Anne31415 commited on
Commit
e68277d
·
verified ·
1 Parent(s): b00c7c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -125,7 +125,7 @@ def load_pdf_text(file_path):
125
 
126
  def load_chatbot():
127
  #return load_qa_chain(llm=OpenAI(), chain_type="stuff")
128
- return load_qa_chain(llm=OpenAI(model_name="gpt-3.5-turbo-instruct"), chain_type="stuff")
129
 
130
 
131
  def display_chat_history(chat_history):
@@ -311,7 +311,7 @@ def page1():
311
  # Include the spinner around all processing and display operations
312
  with st.spinner('Eve denkt über Ihre Frage nach...'):
313
  chain = load_chatbot()
314
- docs = VectorStore.similarity_search(query=query, k=10)
315
  with get_openai_callback() as cb:
316
  response = chain.run(input_documents=docs, question=full_query)
317
  response = handle_no_answer(response)
@@ -431,7 +431,7 @@ def page2():
431
 
432
  with st.spinner('Eve denkt über Ihre Frage nach...'):
433
  chain = load_chatbot()
434
- docs = VectorStore.similarity_search(query=query, k=10)
435
  with get_openai_callback() as cb:
436
  response = chain.run(input_documents=docs, question=full_query)
437
  response = handle_no_answer(response) # Process the response through the new function
@@ -554,7 +554,7 @@ def page3():
554
 
555
  with st.spinner('Eve denkt über Ihre Frage nach...'):
556
  chain = load_chatbot()
557
- docs = VectorStore.similarity_search(query=query, k=10)
558
  with get_openai_callback() as cb:
559
  response = chain.run(input_documents=docs, question=full_query)
560
  response = handle_no_answer(response) # Process the response through the new function
 
125
 
126
  def load_chatbot():
127
  #return load_qa_chain(llm=OpenAI(), chain_type="stuff")
128
+ return load_qa_chain(llm=OpenAI(model_name="gpt-3.5-turbo-1106"), chain_type="stuff")
129
 
130
 
131
  def display_chat_history(chat_history):
 
311
  # Include the spinner around all processing and display operations
312
  with st.spinner('Eve denkt über Ihre Frage nach...'):
313
  chain = load_chatbot()
314
+ docs = VectorStore.similarity_search(query=query, k=5)
315
  with get_openai_callback() as cb:
316
  response = chain.run(input_documents=docs, question=full_query)
317
  response = handle_no_answer(response)
 
431
 
432
  with st.spinner('Eve denkt über Ihre Frage nach...'):
433
  chain = load_chatbot()
434
+ docs = VectorStore.similarity_search(query=query, k=5)
435
  with get_openai_callback() as cb:
436
  response = chain.run(input_documents=docs, question=full_query)
437
  response = handle_no_answer(response) # Process the response through the new function
 
554
 
555
  with st.spinner('Eve denkt über Ihre Frage nach...'):
556
  chain = load_chatbot()
557
+ docs = VectorStore.similarity_search(query=query, k=5)
558
  with get_openai_callback() as cb:
559
  response = chain.run(input_documents=docs, question=full_query)
560
  response = handle_no_answer(response) # Process the response through the new function