Shreyas094 commited on
Commit
ff9e8ca
·
verified ·
1 Parent(s): ca9bb83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -169,7 +169,7 @@ def respond(message, history, model, temperature, num_calls, use_web_search):
169
  for main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature):
170
  yield f"{main_content}\n\n{sources}"
171
  else:
172
- for partial_response in get_response_from_pdf(message, model, num_calls=num_calls, temperature=temperature):
173
  yield partial_response
174
 
175
  def get_response_with_search(query, model, num_calls=3, temperature=0.2):
@@ -226,7 +226,7 @@ Write a detailed and complete response that answers the following user question:
226
  if message.choices and message.choices[0].delta and message.choices[0].delta.content:
227
  chunk = message.choices[0].delta.content
228
  response += chunk
229
- yield response # Yield partial response
230
 
231
  def vote(data: gr.LikeData):
232
  if data.liked:
 
169
  for main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature):
170
  yield f"{main_content}\n\n{sources}"
171
  else:
172
+ for partial_response, _ in get_response_from_pdf(message, model, num_calls=num_calls, temperature=temperature):
173
  yield partial_response
174
 
175
  def get_response_with_search(query, model, num_calls=3, temperature=0.2):
 
226
  if message.choices and message.choices[0].delta and message.choices[0].delta.content:
227
  chunk = message.choices[0].delta.content
228
  response += chunk
229
+ yield response, "" # Yield accumulated response with an empty string for consistency
230
 
231
  def vote(data: gr.LikeData):
232
  if data.liked: