sam2ai commited on
Commit
bbbe5a6
1 Parent(s): 7c83f89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -38,9 +38,15 @@ def stream_chat(message: Dict[str, str], history: list):
38
  # {'text': 'continue?', 'files': []}
39
  # [[('image-xxx.jpg',), None], ['what is this', 'a image.']]
40
 
 
41
  image_path = None
42
- if len(message.files) != 0:
43
- image_path = message.files[0].path
 
 
 
 
 
44
 
45
  if len(history) != 0 and isinstance(history[0][0], tuple):
46
  image_path = history[0][0][0]
 
38
  # {'text': 'continue?', 'files': []}
39
  # [[('image-xxx.jpg',), None], ['what is this', 'a image.']]
40
 
41
+ files = message.get('files', [])
42
  image_path = None
43
+
44
+ if files:
45
+ image_path = files[0]['path']
46
+
47
+ # image_path = None
48
+ # if len(message.files) != 0:
49
+ # image_path = message.files[0].path
50
 
51
  if len(history) != 0 and isinstance(history[0][0], tuple):
52
  image_path = history[0][0][0]