DaddyDaniel commited on
Commit
9a674b1
·
verified ·
1 Parent(s): 1d66415

Adjust error handling on inference fail

Browse files
Files changed (1) hide show
  1. sketch2diagram.py +1 -2
sketch2diagram.py CHANGED
@@ -53,8 +53,7 @@ if generate_command:
53
  output = run_inference(input_file, model_name, args)[0]
54
  except Exception as e:
55
  st.error(f"Inference failed: {e}")
56
- st.session_state.clear()
57
- # return # <-- REMOVE THIS LINE!
58
  else:
59
  pdf_file_path = compile_tikz_to_pdf(output)
60
  if output and pdf_file_path:
 
53
  output = run_inference(input_file, model_name, args)[0]
54
  except Exception as e:
55
  st.error(f"Inference failed: {e}")
56
+ st.stop()
 
57
  else:
58
  pdf_file_path = compile_tikz_to_pdf(output)
59
  if output and pdf_file_path: