Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -117,6 +117,16 @@ def bot_streaming(message, history, together_api_key, max_new_tokens=250, temper
|
|
| 117 |
user_text = ""
|
| 118 |
|
| 119 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
content.append({
|
| 121 |
"role": "user",
|
| 122 |
"content": [
|
|
|
|
| 117 |
user_text = ""
|
| 118 |
|
| 119 |
try:
|
| 120 |
+
image_path = ''
|
| 121 |
+
if 'files' in message and len(message['files']) > 0:
|
| 122 |
+
file_info = message['files'][0]
|
| 123 |
+
if isinstance(file_info, dict) and 'path' in file_info:
|
| 124 |
+
image_path = file_info['path']
|
| 125 |
+
elif isinstance(file_info, str):
|
| 126 |
+
image_path = file_info
|
| 127 |
+
else:
|
| 128 |
+
raise ValueError("Invalid file information provided.")
|
| 129 |
+
|
| 130 |
content.append({
|
| 131 |
"role": "user",
|
| 132 |
"content": [
|