Spaces:
Running
on
L40S
Running
on
L40S
ryanzhangfan
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import subprocess
|
2 |
-
subprocess.run("pip install gradio==4.44.0", shell=True)
|
3 |
|
4 |
from PIL import Image
|
5 |
import gradio as gr
|
@@ -170,7 +170,7 @@ def chat(history, user_input, user_image):
|
|
170 |
# Use Emu3-Chat for vision-language understanding
|
171 |
response = vision_language_understanding(user_image, user_input)
|
172 |
# Append the user input and response to the history
|
173 |
-
history = history + [(user_input, response)]
|
174 |
else:
|
175 |
# Use Emu3-Gen for image generation
|
176 |
generated_image = generate_image(user_input)
|
|
|
1 |
import subprocess
|
2 |
+
# subprocess.run("pip install gradio==4.44.0", shell=True)
|
3 |
|
4 |
from PIL import Image
|
5 |
import gradio as gr
|
|
|
170 |
# Use Emu3-Chat for vision-language understanding
|
171 |
response = vision_language_understanding(user_image, user_input)
|
172 |
# Append the user input and response to the history
|
173 |
+
history = history + [(user_image, ""), (user_input, response)]
|
174 |
else:
|
175 |
# Use Emu3-Gen for image generation
|
176 |
generated_image = generate_image(user_input)
|