hsienchen commited on
Commit
a6b6eba
1 Parent(s): b978289

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -56,9 +56,10 @@ def preprocess_chat_history(
56
 
57
 
58
  def upload(files: Optional[List[str]], chatbot: CHAT_HISTORY) -> CHAT_HISTORY:
59
- for file_path in files:
60
- image_path = gr.Image(type="filepath")
61
- image_path.process(file_path)
 
62
  chatbot.append(((image_path,), None))
63
  return chatbot
64
 
 
56
 
57
 
58
  def upload(files: Optional[List[str]], chatbot: CHAT_HISTORY) -> CHAT_HISTORY:
59
+ for file in files:
60
+ image = Image.open(file).convert('RGB')
61
+ image = preprocess_image(image)
62
+ image_path = cache_pil_image(image)
63
  chatbot.append(((image_path,), None))
64
  return chatbot
65