Spaces:
Runtime error
Runtime error
anilbhatt1
commited on
App.py modified to append "Please describe this image." text if image only is received as input
Browse files
app.py
CHANGED
@@ -185,6 +185,13 @@ def gradio_get_answers_fn(image=None, audio=None, text=None):
|
|
185 |
if text:
|
186 |
text_tokens = tokenizer.encode(text)
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
if image or audio or text:
|
189 |
input_embed = prepare_input_embed(image, audio_tokens, text_tokens)
|
190 |
with torch.no_grad():
|
|
|
185 |
if text:
|
186 |
text_tokens = tokenizer.encode(text)
|
187 |
|
188 |
+
if image:
|
189 |
+
if audio or text:
|
190 |
+
pass
|
191 |
+
else:
|
192 |
+
text = "Please describe this image."
|
193 |
+
text_tokens = tokenizer.encode(text)
|
194 |
+
|
195 |
if image or audio or text:
|
196 |
input_embed = prepare_input_embed(image, audio_tokens, text_tokens)
|
197 |
with torch.no_grad():
|