shtif commited on
Commit
8f26b20
·
1 Parent(s): 331bc97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -11,8 +11,10 @@ model = BlipForConditionalGeneration.from_pretrained(model_id)
11
  processor = BlipProcessor.from_pretrained(model_id)
12
 
13
  def launch(input):
14
- arr = numpy.asarray(input)
15
- inputs = processor(arr, return_tensors="pt")
 
 
16
  out = model.generate(**inputs)
17
  return processor.decode(out[0], skip_special_tokens=True)
18
 
 
11
  processor = BlipProcessor.from_pretrained(model_id)
12
 
13
  def launch(input):
14
+ inputs = []
15
+ for image in input:
16
+ inputs.append(processor(image, return_tensors="pt"))
17
+
18
  out = model.generate(**inputs)
19
  return processor.decode(out[0], skip_special_tokens=True)
20