shabul commited on
Commit
be033bd
·
verified ·
1 Parent(s): a743b5c

Better exception capture to diagnose generation failure

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -95,7 +95,7 @@ def respond(message: str, history: list[dict], max_new_tokens: int, temperature:
95
  try:
96
  model.generate(**gen_kwargs)
97
  except Exception as e:
98
- gen_exception.append(e)
99
  streamer.end()
100
 
101
  thread = threading.Thread(target=generate_with_catch, daemon=True)
 
95
  try:
96
  model.generate(**gen_kwargs)
97
  except Exception as e:
98
+ gen_exception.append(f"{type(e).__name__}: {repr(e)}")
99
  streamer.end()
100
 
101
  thread = threading.Thread(target=generate_with_catch, daemon=True)