Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
#24
by
MaziyarPanahi
- opened
app.py
CHANGED
@@ -41,9 +41,9 @@ def bot_streaming(message, history):
|
|
41 |
|
42 |
|
43 |
try:
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
except NameError:
|
48 |
# Handle the case where 'image' is not defined at all
|
49 |
gr.Error("You need to upload an image for LLaVA to work.")
|
@@ -69,7 +69,7 @@ def bot_streaming(message, history):
|
|
69 |
buffer += new_text
|
70 |
|
71 |
generated_text_without_prompt = buffer[len(text_prompt):]
|
72 |
-
time.sleep(0.
|
73 |
yield generated_text_without_prompt
|
74 |
|
75 |
|
|
|
41 |
|
42 |
|
43 |
try:
|
44 |
+
if image is None:
|
45 |
+
# Handle the case where image is None
|
46 |
+
gr.Error("You need to upload an image for LLaVA to work.")
|
47 |
except NameError:
|
48 |
# Handle the case where 'image' is not defined at all
|
49 |
gr.Error("You need to upload an image for LLaVA to work.")
|
|
|
69 |
buffer += new_text
|
70 |
|
71 |
generated_text_without_prompt = buffer[len(text_prompt):]
|
72 |
+
time.sleep(0.04)
|
73 |
yield generated_text_without_prompt
|
74 |
|
75 |
|