v1
Browse files
app.py
CHANGED
|
@@ -81,7 +81,7 @@ def bot_streaming(message, history, link, temperature, new_max_token, top_p):
|
|
| 81 |
image_token_number = None
|
| 82 |
if len(message['files']) != 0:
|
| 83 |
# Image Load
|
| 84 |
-
image = pil_to_tensor(Image.open(
|
| 85 |
if "3.8B" not in link:
|
| 86 |
image_token_number = 1225
|
| 87 |
image = F.interpolate(image.unsqueeze(0), size=(490, 490), mode='bicubic').squeeze(0)
|
|
@@ -122,8 +122,12 @@ def bot_streaming(message, history, link, temperature, new_max_token, top_p):
|
|
| 122 |
# private log print
|
| 123 |
text = message['text']
|
| 124 |
files = message['files']
|
|
|
|
|
|
|
| 125 |
print(f'Text: {text}')
|
| 126 |
print(f'MM Files: {files}')
|
|
|
|
|
|
|
| 127 |
|
| 128 |
|
| 129 |
buffer = ""
|
|
|
|
| 81 |
image_token_number = None
|
| 82 |
if len(message['files']) != 0:
|
| 83 |
# Image Load
|
| 84 |
+
image = pil_to_tensor(Image.open(message['files'][0]).convert("RGB")).convert("RGB"))
|
| 85 |
if "3.8B" not in link:
|
| 86 |
image_token_number = 1225
|
| 87 |
image = F.interpolate(image.unsqueeze(0), size=(490, 490), mode='bicubic').squeeze(0)
|
|
|
|
| 122 |
# private log print
|
| 123 |
text = message['text']
|
| 124 |
files = message['files']
|
| 125 |
+
print('-----------------------------')
|
| 126 |
+
print(f'Link: {link}')
|
| 127 |
print(f'Text: {text}')
|
| 128 |
print(f'MM Files: {files}')
|
| 129 |
+
print(f'Response: {response}')
|
| 130 |
+
print('-----------------------------\n')
|
| 131 |
|
| 132 |
|
| 133 |
buffer = ""
|