Spaces:
Sleeping
Sleeping
MaziyarPanahi
commited on
Commit
•
8eae1e0
1
Parent(s):
70f2766
Update app.py (#24)
Browse files- Update app.py (5699a695485f50f584bf074f66280cfae900ae51)
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 |
|