not-lain commited on
Commit
b576ed1
1 Parent(s): 24ff16d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -45,20 +45,11 @@ def ovis_chat(message, history):
45
  })
46
  # case history pair has an image
47
  elif isinstance(msg[0],tuple):
48
- # case user did not pass a new image
49
- # we override the none with the new image
50
  if image_input is None :
51
  # if someone uploads a file and not an image this will break
52
  image_input = Image.open(msg[0][0]).convert("RGB")
53
- # we always process the text
54
- conversations.append({
55
- "from": "human",
56
- "value": msg[1][0]
57
- })
58
- conversations.append({
59
- "from": "gpt",
60
- "value": msg[1][1]
61
- })
62
  print("conversations : ",conversations)
63
  return "hi"
64
 
 
45
  })
46
  # case history pair has an image
47
  elif isinstance(msg[0],tuple):
48
+ # case history pair is an image and user did not pass a new image
49
+ # we override the none with the history image
50
  if image_input is None :
51
  # if someone uploads a file and not an image this will break
52
  image_input = Image.open(msg[0][0]).convert("RGB")
 
 
 
 
 
 
 
 
 
53
  print("conversations : ",conversations)
54
  return "hi"
55