Spaces:
Running
on
Zero
Running
on
Zero
Update app_dialogue.py
Browse files- app_dialogue.py +7 -4
app_dialogue.py
CHANGED
@@ -278,11 +278,11 @@ def model_inference(
|
|
278 |
):
|
279 |
print('user _prmt=', user_prompt)
|
280 |
print('chathostoy= ', chat_history)
|
281 |
-
if user_prompt["text"].strip() == "" and not user_prompt["files"]:
|
282 |
-
|
283 |
|
284 |
-
if user_prompt["text"].strip() == "" and user_prompt["files"]:
|
285 |
-
|
286 |
|
287 |
streamer = TextIteratorStreamer(
|
288 |
PROCESSOR.tokenizer,
|
@@ -317,6 +317,9 @@ def model_inference(
|
|
317 |
user_prompt=user_prompt,
|
318 |
chat_history=chat_history,
|
319 |
)
|
|
|
|
|
|
|
320 |
prompt = PROCESSOR.apply_chat_template(resulting_text, add_generation_prompt=True)
|
321 |
inputs = PROCESSOR(
|
322 |
text=prompt,
|
|
|
278 |
):
|
279 |
print('user _prmt=', user_prompt)
|
280 |
print('chathostoy= ', chat_history)
|
281 |
+
# if user_prompt["text"].strip() == "" and not user_prompt["files"]:
|
282 |
+
# gr.Error("Please input a query and optionally image(s).")
|
283 |
|
284 |
+
# if user_prompt["text"].strip() == "" and user_prompt["files"]:
|
285 |
+
# gr.Error("Please input a text query along the image(s).")
|
286 |
|
287 |
streamer = TextIteratorStreamer(
|
288 |
PROCESSOR.tokenizer,
|
|
|
317 |
user_prompt=user_prompt,
|
318 |
chat_history=chat_history,
|
319 |
)
|
320 |
+
print('resulting text ', resulting_text)
|
321 |
+
print('resulting images ', resulting_images)
|
322 |
+
|
323 |
prompt = PROCESSOR.apply_chat_template(resulting_text, add_generation_prompt=True)
|
324 |
inputs = PROCESSOR(
|
325 |
text=prompt,
|