pseudotensor commited on
Commit
8a46296
1 Parent(s): a0e2e84

Update with h2oGPT hash ad1904340588c4d0f3c99fd78bcd3a52c37407f5

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1409,6 +1409,7 @@ def evaluate(
1409
  else:
1410
  raise
1411
 
 
1412
  for output in CallbackToGenerator(generate, callback=None, **gen_kwargs):
1413
  decoded_output = decoder(output)
1414
  if output[-1] in [tokenizer.eos_token_id]:
@@ -1419,7 +1420,7 @@ def evaluate(
1419
  raise StopIteration
1420
  yield prompter.get_response(decoded_output, prompt=inputs_decoded,
1421
  sanitize_bot_response=sanitize_bot_response)
1422
- if save_path:
1423
  save_generate_output(output=decoded_output, base_model=base_model, json_file_path=save_path)
1424
  return
1425
  else:
 
1409
  else:
1410
  raise
1411
 
1412
+ decoded_output = None
1413
  for output in CallbackToGenerator(generate, callback=None, **gen_kwargs):
1414
  decoded_output = decoder(output)
1415
  if output[-1] in [tokenizer.eos_token_id]:
 
1420
  raise StopIteration
1421
  yield prompter.get_response(decoded_output, prompt=inputs_decoded,
1422
  sanitize_bot_response=sanitize_bot_response)
1423
+ if save_path and decoded_output:
1424
  save_generate_output(output=decoded_output, base_model=base_model, json_file_path=save_path)
1425
  return
1426
  else: