ryanzhangfan
commited on
Commit
•
8a3eb3c
1
Parent(s):
a1041e9
Update app.py
Browse files
app.py
CHANGED
@@ -178,8 +178,10 @@ def chat(history, user_input, user_image):
|
|
178 |
# Use Emu3-Chat for vision-language understanding
|
179 |
response = vision_language_understanding(user_image, user_input)
|
180 |
# Append the user input and response to the history
|
181 |
-
history = history + [(image2str(user_image) + "
|
182 |
else:
|
|
|
|
|
183 |
# Use Emu3-Gen for image generation
|
184 |
generated_image = generate_image(user_input)
|
185 |
if generated_image is not None:
|
@@ -190,6 +192,7 @@ def chat(history, user_input, user_image):
|
|
190 |
history = history + [
|
191 |
(user_input, "Sorry, I could not generate an image.")
|
192 |
]
|
|
|
193 |
return history, history, gr.update(value=None)
|
194 |
|
195 |
def clear_input():
|
|
|
178 |
# Use Emu3-Chat for vision-language understanding
|
179 |
response = vision_language_understanding(user_image, user_input)
|
180 |
# Append the user input and response to the history
|
181 |
+
history = history + [(image2str(user_image) + "<br>" + user_input, response)]
|
182 |
else:
|
183 |
+
history = history + [(user_input, "Currently do not support image genration, please provide an valid image.")]
|
184 |
+
"""
|
185 |
# Use Emu3-Gen for image generation
|
186 |
generated_image = generate_image(user_input)
|
187 |
if generated_image is not None:
|
|
|
192 |
history = history + [
|
193 |
(user_input, "Sorry, I could not generate an image.")
|
194 |
]
|
195 |
+
"""
|
196 |
return history, history, gr.update(value=None)
|
197 |
|
198 |
def clear_input():
|