psyne commited on
Commit
9e50206
·
1 Parent(s): e0f54ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -103,7 +103,7 @@ def load_recommender(paths, start_page=1):
103
  return 'Corpus Loaded.'
104
 
105
 
106
- def generate_text(prompt,engine):
107
  completions = openai.Completion.create(
108
  engine=engine,
109
  prompt=prompt,
@@ -117,7 +117,6 @@ def generate_text(prompt,engine):
117
 
118
 
119
  def generate_answer(question):
120
- engine = os.environ('Engine')
121
  topn_chunks = recommender(question)
122
  prompt = ""
123
  prompt += 'search results:\n\n'
@@ -134,7 +133,7 @@ def generate_answer(question):
134
  "answer should be short and concise.\n\nQuery: {question}\nAnswer: "
135
 
136
  prompt += f"Query: {question}\nAnswer:"
137
- answer = generate_text(prompt, engine)
138
  return answer
139
 
140
 
 
103
  return 'Corpus Loaded.'
104
 
105
 
106
+ def generate_text(prompt, engine="mlsgpt3"):
107
  completions = openai.Completion.create(
108
  engine=engine,
109
  prompt=prompt,
 
117
 
118
 
119
  def generate_answer(question):
 
120
  topn_chunks = recommender(question)
121
  prompt = ""
122
  prompt += 'search results:\n\n'
 
133
  "answer should be short and concise.\n\nQuery: {question}\nAnswer: "
134
 
135
  prompt += f"Query: {question}\nAnswer:"
136
+ answer = generate_text(prompt)
137
  return answer
138
 
139