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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -11,9 +11,9 @@ model = BlipForConditionalGeneration.from_pretrained(model_id)
11
  processor = BlipProcessor.from_pretrained(model_id)
12
 
13
  def launch(input):
14
- #image = Image.open(requests.get(input, stream=True).raw).convert('RGB')
15
- inputs = processor(input, return_tensors="pt")
16
- out = model.generate(**inputs)
17
  return processor.decode(out[0], skip_special_tokens=True)
18
 
19
  description = "Simple BLIP test app for image captioning."
 
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
 
19
  description = "Simple BLIP test app for image captioning."