Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def predict(image,max_length=64, num_beams=4):
|
|
20 |
clean_text = lambda x: x.replace('<|endoftext|>','').split('\n')[0]
|
21 |
caption_ids = model.generate(image, max_length = max_length)[0]
|
22 |
caption_text = clean_text(tokenizer.decode(caption_ids))
|
23 |
-
caption_text2 =
|
24 |
return caption_text, caption_text2
|
25 |
|
26 |
blip_processor_large = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
|
|
|
20 |
clean_text = lambda x: x.replace('<|endoftext|>','').split('\n')[0]
|
21 |
caption_ids = model.generate(image, max_length = max_length)[0]
|
22 |
caption_text = clean_text(tokenizer.decode(caption_ids))
|
23 |
+
caption_text2 = generate_captions(image)
|
24 |
return caption_text, caption_text2
|
25 |
|
26 |
blip_processor_large = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
|