Update app.py
Browse files
app.py
CHANGED
@@ -60,9 +60,9 @@ def getProductDetails(history, image):
|
|
60 |
# for response in stream:
|
61 |
# output += response.token.text
|
62 |
# yield [(prompt, output)]
|
63 |
-
|
64 |
# history.append((prompt, output))
|
65 |
-
|
66 |
|
67 |
@torch.no_grad()
|
68 |
def getImageDescription(image):
|
@@ -120,6 +120,7 @@ def getImageDescription(image):
|
|
120 |
# history[-1][1] = partial_response
|
121 |
# yield history
|
122 |
gr.Info('Got:' + partial_response)
|
|
|
123 |
|
124 |
def resize_image(image):
|
125 |
image = image.convert('RGB')
|
@@ -178,7 +179,7 @@ with gr.Blocks(css=css) as demo:
|
|
178 |
output = gr.Image(type="pil", interactive=False)
|
179 |
|
180 |
response_handler = (
|
181 |
-
|
182 |
[image],
|
183 |
[]
|
184 |
)
|
|
|
60 |
# for response in stream:
|
61 |
# output += response.token.text
|
62 |
# yield [(prompt, output)]
|
63 |
+
gr.Info('Gemma:' + product_description)
|
64 |
# history.append((prompt, output))
|
65 |
+
return history
|
66 |
|
67 |
@torch.no_grad()
|
68 |
def getImageDescription(image):
|
|
|
120 |
# history[-1][1] = partial_response
|
121 |
# yield history
|
122 |
gr.Info('Got:' + partial_response)
|
123 |
+
return partial_response
|
124 |
|
125 |
def resize_image(image):
|
126 |
image = image.convert('RGB')
|
|
|
179 |
output = gr.Image(type="pil", interactive=False)
|
180 |
|
181 |
response_handler = (
|
182 |
+
getProductDetails,
|
183 |
[image],
|
184 |
[]
|
185 |
)
|