bstraehle commited on
Commit
b511565
1 Parent(s): 2798fff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -104,21 +104,20 @@ def create_run(client, assistant, thread):
104
 
105
  def wait_on_run(client, thread, run):
106
  while run.status == "queued" or run.status == "in_progress":
107
- print("### " + run.status)
108
  run = client.beta.threads.runs.retrieve(
109
  thread_id=thread.id,
110
  run_id=run.id,
111
  )
112
-
 
 
113
  time.sleep(0.5)
114
 
115
  show_json("run", run)
116
 
117
- if hasattr(run, "error"):
118
- print("###")
119
- print(run.error)
120
- print("###")
121
-
122
  return run
123
 
124
  def get_run_steps(client, thread, run):
 
104
 
105
  def wait_on_run(client, thread, run):
106
  while run.status == "queued" or run.status == "in_progress":
 
107
  run = client.beta.threads.runs.retrieve(
108
  thread_id=thread.id,
109
  run_id=run.id,
110
  )
111
+
112
+ print(run.status)
113
+
114
  time.sleep(0.5)
115
 
116
  show_json("run", run)
117
 
118
+ if hasattr(run, "last_error") and run.error:
119
+ raise gr.Error(run.error)
120
+
 
 
121
  return run
122
 
123
  def get_run_steps(client, thread, run):