Update app.py
Browse files
app.py
CHANGED
@@ -28,10 +28,10 @@ class StopOnTokens(StoppingCriteria):
|
|
28 |
return False
|
29 |
|
30 |
@torch.no_grad()
|
31 |
-
def response(
|
32 |
gr.Info('Starting...' + message)
|
33 |
stop = StopOnTokens()
|
34 |
-
|
35 |
messages = [{"role": "system", "content": "You are a helpful assistant."}]
|
36 |
|
37 |
for user_msg, assistant_msg in history:
|
@@ -93,7 +93,7 @@ with gr.Blocks(css=css, js="bg-remove2.js") as demo:
|
|
93 |
|
94 |
response_handler = (
|
95 |
response,
|
96 |
-
[
|
97 |
[chat]
|
98 |
)
|
99 |
|
|
|
28 |
return False
|
29 |
|
30 |
@torch.no_grad()
|
31 |
+
def response(history, image):
|
32 |
gr.Info('Starting...' + message)
|
33 |
stop = StopOnTokens()
|
34 |
+
message = "Generate a product title for the image"
|
35 |
messages = [{"role": "system", "content": "You are a helpful assistant."}]
|
36 |
|
37 |
for user_msg, assistant_msg in history:
|
|
|
93 |
|
94 |
response_handler = (
|
95 |
response,
|
96 |
+
[chat, image],
|
97 |
[chat]
|
98 |
)
|
99 |
|