Spaces:
Runtime error
Runtime error
Penghao Wu
commited on
Commit
·
fcfe29d
1
Parent(s):
323cabb
fix invalid input txt
Browse files
app.py
CHANGED
@@ -117,7 +117,7 @@ def inference(input_str, input_image):
|
|
117 |
if not re.match(r"^[A-Za-z ,.!?\'\"]+$", input_str) or len(input_str) < 1:
|
118 |
output_str = "[Error] Invalid input: ", input_str
|
119 |
torch.cuda.empty_cache()
|
120 |
-
return output_str, None
|
121 |
|
122 |
# Model Inference
|
123 |
# check whether we need additional visual information
|
|
|
117 |
if not re.match(r"^[A-Za-z ,.!?\'\"]+$", input_str) or len(input_str) < 1:
|
118 |
output_str = "[Error] Invalid input: ", input_str
|
119 |
torch.cuda.empty_cache()
|
120 |
+
return output_str, None, None, None
|
121 |
|
122 |
# Model Inference
|
123 |
# check whether we need additional visual information
|