Spaces:
Runtime error
Runtime error
fix empty input bug
Browse files
app.py
CHANGED
@@ -185,13 +185,15 @@ def _launch_demo(args):
|
|
185 |
|
186 |
def add_text(history, task_history, text):
|
187 |
task_text = text
|
188 |
-
|
189 |
-
|
190 |
history = history + [(_parse_text(text), None)]
|
191 |
task_history = task_history + [(task_text, None)]
|
192 |
return history, task_history, ""
|
193 |
|
194 |
def add_file(history, task_history, file):
|
|
|
|
|
195 |
history = history + [((file.name,), None)]
|
196 |
task_history = task_history + [((file.name,), None)]
|
197 |
return history, task_history
|
|
|
185 |
|
186 |
def add_text(history, task_history, text):
|
187 |
task_text = text
|
188 |
+
history = history if history is not None else []
|
189 |
+
task_history = task_history if task_history is not None else []
|
190 |
history = history + [(_parse_text(text), None)]
|
191 |
task_history = task_history + [(task_text, None)]
|
192 |
return history, task_history, ""
|
193 |
|
194 |
def add_file(history, task_history, file):
|
195 |
+
history = history if history is not None else []
|
196 |
+
task_history = task_history if task_history is not None else []
|
197 |
history = history + [((file.name,), None)]
|
198 |
task_history = task_history + [((file.name,), None)]
|
199 |
return history, task_history
|