Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -47,9 +47,9 @@ def format_prompt(message, history):
|
|
47 |
prompt += f"<start_of_turn>user{message}<end_of_turn><start_of_turn>modelo"
|
48 |
return prompt
|
49 |
|
50 |
-
def getProductTitle(history, image):
|
51 |
product_description=getImageDescription(image)
|
52 |
-
prompt="
|
53 |
yield interactWithModel(history, prompt)
|
54 |
|
55 |
def getProductDescription(history):
|
@@ -185,6 +185,7 @@ with gr.Blocks(css=css) as demo:
|
|
185 |
with gr.Column(elem_id="col-container"):
|
186 |
image = gr.Image(type="pil")
|
187 |
output = gr.Image(type="pil", interactive=False)
|
|
|
188 |
submit = gr.Button(value="Upload", variant="primary")
|
189 |
with gr.Column():
|
190 |
chat = gr.Chatbot(show_label=False)
|
@@ -193,7 +194,7 @@ with gr.Blocks(css=css) as demo:
|
|
193 |
|
194 |
title_handler = (
|
195 |
getProductTitle,
|
196 |
-
[chat, image],
|
197 |
[chat]
|
198 |
)
|
199 |
|
|
|
47 |
prompt += f"<start_of_turn>user{message}<end_of_turn><start_of_turn>modelo"
|
48 |
return prompt
|
49 |
|
50 |
+
def getProductTitle(history, context, image):
|
51 |
product_description=getImageDescription(image)
|
52 |
+
prompt="We have a product which is a" + context + ". Product description is as follows: " + product_description + ". Please write a product title options for it."
|
53 |
yield interactWithModel(history, prompt)
|
54 |
|
55 |
def getProductDescription(history):
|
|
|
185 |
with gr.Column(elem_id="col-container"):
|
186 |
image = gr.Image(type="pil")
|
187 |
output = gr.Image(type="pil", interactive=False)
|
188 |
+
context = gr.Textbox(label="Small description")
|
189 |
submit = gr.Button(value="Upload", variant="primary")
|
190 |
with gr.Column():
|
191 |
chat = gr.Chatbot(show_label=False)
|
|
|
194 |
|
195 |
title_handler = (
|
196 |
getProductTitle,
|
197 |
+
[chat, context, image],
|
198 |
[chat]
|
199 |
)
|
200 |
|