Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
12 |
-
caption = caption[:-1]
|
13 |
-
story = p(caption)[0]["generated_text"]
|
14 |
return story
|
15 |
|
16 |
-
gr.Interface(im2story, gr.Image(type="filepath"), "text"
|
|
|
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()
|