sshenai commited on
Commit
0ff16be
·
verified ·
1 Parent(s): 5a3ae9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,9 +9,9 @@ from transformers import pipeline
9
 
10
  # Generates a caption for the given image using a pre-trained model
11
  def image_to_caption(image_path):
12
- imgtocaption = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
13
- caption = imgtocaption(image_path)[0]['generated_text']
14
- return caption
15
 
16
  # Generates a story for the caption using a pre-trained model
17
  def caption_to_story(text):
 
9
 
10
  # Generates a caption for the given image using a pre-trained model
11
  def image_to_caption(image_path):
12
+ imgtocaption = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
13
+ caption = imgtocaption(image_path)[0]['generated_text']
14
+ return caption
15
 
16
  # Generates a story for the caption using a pre-trained model
17
  def caption_to_story(text):