Update app.py
Browse files
app.py
CHANGED
@@ -67,11 +67,11 @@ def getProductDetails(history, image):
|
|
67 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
68 |
output = ""
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
gr.Info('Gemma:' + product_description)
|
74 |
-
|
75 |
return history
|
76 |
|
77 |
@torch.no_grad()
|
|
|
67 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
68 |
output = ""
|
69 |
|
70 |
+
for response in stream:
|
71 |
+
output += response.token.text
|
72 |
+
yield [(prompt, output)]
|
73 |
gr.Info('Gemma:' + product_description)
|
74 |
+
history.append((prompt, output))
|
75 |
return history
|
76 |
|
77 |
@torch.no_grad()
|