Update app.py
Browse files
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 |
-
|
| 15 |
-
inputs = processor(
|
| 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."
|