Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -225,8 +225,11 @@ def simple_chat(message, temperature: float = 0.8, max_length: int = 4096, top_p
|
|
| 225 |
conversation = []
|
| 226 |
|
| 227 |
if message["file_content"]:
|
| 228 |
-
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
| 230 |
#choice, contents = mode_load(message["file_content"])
|
| 231 |
if choice == "image":
|
| 232 |
conversation.append({"role": "user", "image": contents, "content": message['text']})
|
|
|
|
| 225 |
conversation = []
|
| 226 |
|
| 227 |
if message["file_content"]:
|
| 228 |
+
with open(message['file_name'], 'wb') as temp_file:
|
| 229 |
+
temp_file.write(message['file_content'].read())
|
| 230 |
+
temp_file_path = temp_file.name
|
| 231 |
+
|
| 232 |
+
choice, contents = mode_load(temp_file_path)
|
| 233 |
#choice, contents = mode_load(message["file_content"])
|
| 234 |
if choice == "image":
|
| 235 |
conversation.append({"role": "user", "image": contents, "content": message['text']})
|