andreinigo commited on
Commit
9557af7
·
1 Parent(s): f74df77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,7 +16,7 @@ os.environ["OPENAI_API_KEY"] = 'sk-'+ os.environ["OPENAI_API_KEY"]
16
  def proper_query(query):
17
  prompt = f"The following text is a user's question: {query}\n\nHow should that question be modified so that it uses correct language?\nReturn the question in the same language.\nCorrected Question:"
18
  response = openai.Completion.create(
19
- engine="text-davinci-003", prompt=prompt, max_tokens=1000, temperature=0.3)
20
  return response.choices[0].text
21
 
22
 
@@ -77,7 +77,7 @@ def asesor_avianca(query):
77
  initial_qa_prompt = PromptTemplate(
78
  input_variables=["context_str", "question"], template=initial_qa_template
79
  )
80
- chain = load_qa_chain(OpenAI(temperature=0.2), chain_type="refine", return_refine_steps=False,
81
  question_prompt=initial_qa_prompt, refine_prompt=refine_prompt)
82
  ans = chain({"input_documents": docs, "question": query}, return_only_outputs=True)['output_text']
83
  return ans
 
16
  def proper_query(query):
17
  prompt = f"The following text is a user's question: {query}\n\nHow should that question be modified so that it uses correct language?\nReturn the question in the same language.\nCorrected Question:"
18
  response = openai.Completion.create(
19
+ engine="text-davinci-003", prompt=prompt, max_tokens=1000, temperature=0.1)
20
  return response.choices[0].text
21
 
22
 
 
77
  initial_qa_prompt = PromptTemplate(
78
  input_variables=["context_str", "question"], template=initial_qa_template
79
  )
80
+ chain = load_qa_chain(OpenAI(temperature=0.1), chain_type="refine", return_refine_steps=False,
81
  question_prompt=initial_qa_prompt, refine_prompt=refine_prompt)
82
  ans = chain({"input_documents": docs, "question": query}, return_only_outputs=True)['output_text']
83
  return ans