Update app.py
Browse files
app.py
CHANGED
|
@@ -56,9 +56,10 @@ def preprocess_chat_history(
|
|
| 56 |
|
| 57 |
|
| 58 |
def upload(files: Optional[List[str]], chatbot: CHAT_HISTORY) -> CHAT_HISTORY:
|
| 59 |
-
for
|
| 60 |
-
|
| 61 |
-
|
|
|
|
| 62 |
chatbot.append(((image_path,), None))
|
| 63 |
return chatbot
|
| 64 |
|
|
|
|
| 56 |
|
| 57 |
|
| 58 |
def upload(files: Optional[List[str]], chatbot: CHAT_HISTORY) -> CHAT_HISTORY:
|
| 59 |
+
for file in files:
|
| 60 |
+
image = Image.open(file).convert('RGB')
|
| 61 |
+
image = preprocess_image(image)
|
| 62 |
+
image_path = cache_pil_image(image)
|
| 63 |
chatbot.append(((image_path,), None))
|
| 64 |
return chatbot
|
| 65 |
|