ManishThota commited on
Commit
a58a8ea
1 Parent(s): a4001c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -42,7 +42,7 @@ tokenizer = AutoTokenizer.from_pretrained("ManishThota/Sparrow", trust_remote_co
42
  def predict_answer(image, question, max_tokens):
43
  #Set inputs
44
  text = f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: <image>\n{question}? ASSISTANT:"
45
- image = Image.open(image)
46
 
47
  input_ids = tokenizer(text, return_tensors='pt').input_ids
48
  image_tensor = model.image_preprocess(image)
 
42
  def predict_answer(image, question, max_tokens):
43
  #Set inputs
44
  text = f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: <image>\n{question}? ASSISTANT:"
45
+ image = image.convert("RGB")
46
 
47
  input_ids = tokenizer(text, return_tensors='pt').input_ids
48
  image_tensor = model.image_preprocess(image)