pseudotensor commited on
Commit
db2d570
1 Parent(s): 11e2786
Files changed (1) hide show
  1. src/gen.py +2 -2
src/gen.py CHANGED
@@ -2715,7 +2715,7 @@ def evaluate(
2715
  res = job.communicator.job.outputs[-1]
2716
  res_dict = ast.literal_eval(res)
2717
  text = res_dict['response']
2718
- sources = res_dict['sources']
2719
  if gr_prompt_type == 'plain':
2720
  # then gradio server passes back full prompt + text
2721
  prompt_and_text = text
@@ -2736,7 +2736,7 @@ def evaluate(
2736
  res = res_all[-1]
2737
  res_dict = ast.literal_eval(res)
2738
  text = res_dict['response']
2739
- sources = res_dict['sources']
2740
  else:
2741
  # go with old text if last call didn't work
2742
  e = job.future._exception
 
2715
  res = job.communicator.job.outputs[-1]
2716
  res_dict = ast.literal_eval(res)
2717
  text = res_dict['response']
2718
+ sources = res_dict.get('sources', '')
2719
  if gr_prompt_type == 'plain':
2720
  # then gradio server passes back full prompt + text
2721
  prompt_and_text = text
 
2736
  res = res_all[-1]
2737
  res_dict = ast.literal_eval(res)
2738
  text = res_dict['response']
2739
+ sources = res_dict.get('sources', '')
2740
  else:
2741
  # go with old text if last call didn't work
2742
  e = job.future._exception