Update app.py
Browse files
app.py
CHANGED
@@ -75,10 +75,34 @@ def ner_drugs(text):
|
|
75 |
med_iface = gr.Interface(fn=ner_drugs,inputs = "text",outputs=["text"],title="Drugs Named Entity Recognition").queue()
|
76 |
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
demo = gr.TabbedInterface(
|
80 |
|
81 |
-
[txtgen_iface, sum_iface, med_iface], ["Text Generation", "Summary Generation", "Drug Named-entity recognition"],
|
82 |
title="All the Models of UWC",
|
83 |
|
84 |
)
|
|
|
75 |
med_iface = gr.Interface(fn=ner_drugs,inputs = "text",outputs=["text"],title="Drugs Named Entity Recognition").queue()
|
76 |
|
77 |
|
78 |
+
from diffusers import StableDiffusionPipeline
|
79 |
+
|
80 |
+
#pip install accelerate
|
81 |
+
|
82 |
+
#pip install --user
|
83 |
+
|
84 |
+
#pip install --user torch==1.7.0+cu110 torchvision==0.8.1+cu110 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
|
85 |
+
|
86 |
+
pipe = StableDiffusionPipeline.from_pretrained('CompVis/stable-diffusion-v1-4')
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
# Initialize a prompt
|
91 |
+
def stable_image(text):
|
92 |
+
prompt = text
|
93 |
+
# Pass the prompt in the pipeline
|
94 |
+
return pipe(prompt).images[0]
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
import gradio as gr
|
99 |
+
stable_iface = gr.Interface(fn=stable_image, inputs= "text",outputs=["image"],title="Text to Image").queue()
|
100 |
+
|
101 |
+
|
102 |
|
103 |
demo = gr.TabbedInterface(
|
104 |
|
105 |
+
[txtgen_iface, sum_iface, med_iface,stable_iface], ["Text Generation", "Summary Generation", "Drug Named-entity recognition","Text to Image"],
|
106 |
title="All the Models of UWC",
|
107 |
|
108 |
)
|