Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,11 @@ def get_caption(img):
|
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
demo = gr.Blocks()
|
| 30 |
with demo:
|
|
@@ -36,8 +40,8 @@ with demo:
|
|
| 36 |
sum_btn.click(get_summary, sum_input, sum_output)
|
| 37 |
with gr.Tab("Named Entity Recognition"):
|
| 38 |
ner_input = [gr.Textbox(label="Text to find Entities", placeholder = "Enter text...", lines = 4)]
|
| 39 |
-
ner_output = [gr.HighlightedText(label="Text with entities")]
|
| 40 |
ner_btn = gr.Button("Generate entities")
|
|
|
|
| 41 |
ner_btn.click(get_ner, ner_input, ner_output)
|
| 42 |
with gr.Tab("Image Captioning"):
|
| 43 |
cap_input = [gr.Image(label="Upload Image", type="pil")]
|
|
|
|
| 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:
|
|
|
|
| 40 |
sum_btn.click(get_summary, sum_input, sum_output)
|
| 41 |
with gr.Tab("Named Entity Recognition"):
|
| 42 |
ner_input = [gr.Textbox(label="Text to find Entities", placeholder = "Enter text...", lines = 4)]
|
|
|
|
| 43 |
ner_btn = gr.Button("Generate entities")
|
| 44 |
+
ner_output = [gr.HighlightedText(label="Text with entities")]
|
| 45 |
ner_btn.click(get_ner, ner_input, ner_output)
|
| 46 |
with gr.Tab("Image Captioning"):
|
| 47 |
cap_input = [gr.Image(label="Upload Image", type="pil")]
|