hiyouga commited on
Commit
a2f5d42
1 Parent(s): e325f49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -38,12 +38,13 @@ 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
  if len(message["files"]) != 0:
42
  image_path = message["files"][0]
43
 
44
- if isinstance(history[0][0], tuple):
45
  image_path = history[0][0][0]
46
- history.pop(0)
47
 
48
  if image_path is not None:
49
  image = Image.open(image_path)
 
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]
44
 
45
+ if len(history) != 0 and isinstance(history[0][0], tuple):
46
  image_path = history[0][0][0]
47
+ history = history[1:]
48
 
49
  if image_path is not None:
50
  image = Image.open(image_path)