Spaces:
Sleeping
Sleeping
Final updates
Browse files
app.py
CHANGED
@@ -20,16 +20,6 @@ def get_caption(img):
|
|
20 |
output = caption_model(img)
|
21 |
return output[0]["generated_text"]
|
22 |
|
23 |
-
# 4. Image Generation
|
24 |
-
# img_model = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
|
25 |
-
# img_model = DiffusionPipeline.from_pretrained("Linaqruf/anything-v3.0")
|
26 |
-
# def get_img(prompt):
|
27 |
-
# print("Here inside")
|
28 |
-
# img = img_model(prompt)
|
29 |
-
# print("Generated")
|
30 |
-
# return img.images[0]
|
31 |
-
|
32 |
-
|
33 |
demo = gr.Blocks()
|
34 |
with demo:
|
35 |
gr.Markdown("# Try out some cool tasks!")
|
@@ -48,10 +38,5 @@ with demo:
|
|
48 |
cap_btn = gr.Button("Generate Caption")
|
49 |
cap_output = [gr.Textbox(label="Caption")]
|
50 |
cap_btn.click(get_caption, cap_input, cap_output)
|
51 |
-
# with gr.Tab("Image Generation"):
|
52 |
-
# img_input = [gr.Textbox(label="Your Text")]
|
53 |
-
# img_btn = gr.Button("Generate Image")
|
54 |
-
# img_output = [gr.Image(label="Generated Image")]
|
55 |
-
# img_btn.click(get_img, img_input, img_output)
|
56 |
|
57 |
demo.launch()
|
|
|
20 |
output = caption_model(img)
|
21 |
return output[0]["generated_text"]
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
demo = gr.Blocks()
|
24 |
with demo:
|
25 |
gr.Markdown("# Try out some cool tasks!")
|
|
|
38 |
cap_btn = gr.Button("Generate Caption")
|
39 |
cap_output = [gr.Textbox(label="Caption")]
|
40 |
cap_btn.click(get_caption, cap_input, cap_output)
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
demo.launch()
|