Spaces:
Running
Running
suhyun.kang
commited on
Commit
•
2e9ad55
1
Parent(s):
0dd5c06
update
Browse files
app.py
CHANGED
@@ -28,9 +28,6 @@ def user(user_message):
|
|
28 |
|
29 |
|
30 |
def bot(state_a, state_b, request: gr.Request):
|
31 |
-
if state_a is None or state_b is None:
|
32 |
-
raise RuntimeError(f"states cannot be None, got [{state_a}, {state_b}]")
|
33 |
-
|
34 |
new_states = [state_a, state_b]
|
35 |
|
36 |
generators = []
|
@@ -67,6 +64,11 @@ def bot(state_a, state_b, request: gr.Request):
|
|
67 |
except StopIteration:
|
68 |
pass
|
69 |
|
|
|
|
|
|
|
|
|
|
|
70 |
yield new_states + new_responses
|
71 |
|
72 |
if stop:
|
|
|
28 |
|
29 |
|
30 |
def bot(state_a, state_b, request: gr.Request):
|
|
|
|
|
|
|
31 |
new_states = [state_a, state_b]
|
32 |
|
33 |
generators = []
|
|
|
64 |
except StopIteration:
|
65 |
pass
|
66 |
|
67 |
+
# TODO(#1): Narrow down the exception type.
|
68 |
+
except Exception as e: # pylint: disable=broad-except
|
69 |
+
print(f"Error in generator: {e}")
|
70 |
+
raise e
|
71 |
+
|
72 |
yield new_states + new_responses
|
73 |
|
74 |
if stop:
|