Spaces:
Runtime error
Runtime error
Update app_dialogue.py
Browse files- app_dialogue.py +1 -5
app_dialogue.py
CHANGED
@@ -145,7 +145,7 @@ def format_user_prompt_with_im_history_and_system_conditioning(
|
|
145 |
+ [{"type": "text", "text": user_prompt["text"]}],
|
146 |
}
|
147 |
)
|
148 |
-
resulting_images.extend([Image.open(
|
149 |
|
150 |
return resulting_messages, resulting_images
|
151 |
|
@@ -176,10 +176,6 @@ def model_inference(
|
|
176 |
if user_prompt["text"].strip() == "" and user_prompt["files"]:
|
177 |
gr.Error("Please input a text query along the image(s).")
|
178 |
|
179 |
-
for file in user_prompt["files"]:
|
180 |
-
if not file["mime_type"].startswith("image/"):
|
181 |
-
gr.Error("Idefics2 only supports images. Please input a valid image.")
|
182 |
-
|
183 |
streamer = TextIteratorStreamer(
|
184 |
PROCESSOR.tokenizer,
|
185 |
skip_prompt=True,
|
|
|
145 |
+ [{"type": "text", "text": user_prompt["text"]}],
|
146 |
}
|
147 |
)
|
148 |
+
resulting_images.extend([Image.open(path) for path in user_prompt["files"]])
|
149 |
|
150 |
return resulting_messages, resulting_images
|
151 |
|
|
|
176 |
if user_prompt["text"].strip() == "" and user_prompt["files"]:
|
177 |
gr.Error("Please input a text query along the image(s).")
|
178 |
|
|
|
|
|
|
|
|
|
179 |
streamer = TextIteratorStreamer(
|
180 |
PROCESSOR.tokenizer,
|
181 |
skip_prompt=True,
|