abidlabs HF staff commited on
Commit
7e92753
1 Parent(s): 7271789

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -6,11 +6,11 @@ p = pipeline("text-generation", "EleutherAI/gpt-neo-1.3B")
6
 
7
  im2caption = gr.Interface.load("spaces/akhaliq/CLIP_prefix_captioning")
8
 
 
 
9
  def im2story(img):
10
  caption = im2caption(img, "COCO")
11
- if caption[-1] == ".":
12
- caption = caption[:-1]
13
- story = p(caption)[0]["generated_text"]
14
  return story
15
 
16
- gr.Interface(im2story, gr.Image(type="filepath"), "text", title="Image 2 Story").launch()
 
6
 
7
  im2caption = gr.Interface.load("spaces/akhaliq/CLIP_prefix_captioning")
8
 
9
+ im2caption = gr.Interface.load("spaces/akhaliq/CLIP_prefix_captioning")
10
+
11
  def im2story(img):
12
  caption = im2caption(img, "COCO")
13
+ story = p("Let me tell you a story about " + caption)[0]["generated_text"]
 
 
14
  return story
15
 
16
+ gr.Interface(im2story, gr.Image(type="filepath"), "text").launch()