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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -56,10 +56,9 @@ def preprocess_chat_history(
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
 
 
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