Update app.py
Browse files
app.py
CHANGED
@@ -106,34 +106,11 @@ def ner_drugs(text):
|
|
106 |
med_iface = gr.Interface(fn=ner_drugs,inputs = "text",outputs=["text"],title="Drugs Named Entity Recognition").queue()
|
107 |
|
108 |
|
109 |
-
from diffusers import StableDiffusionPipeline
|
110 |
-
|
111 |
-
#pip install accelerate
|
112 |
-
|
113 |
-
#pip install --user
|
114 |
-
|
115 |
-
#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
|
116 |
-
|
117 |
-
pipe = StableDiffusionPipeline.from_pretrained('CompVis/stable-diffusion-v1-4')
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
# Initialize a prompt
|
122 |
-
def stable_image(text):
|
123 |
-
prompt = text
|
124 |
-
# Pass the prompt in the pipeline
|
125 |
-
return pipe(prompt).images[0]
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
import gradio as gr
|
130 |
-
stable_iface = gr.Interface(fn=stable_image, inputs= ["text"],outputs=gr.Image(type="pil"),title="Text To Image").queue()
|
131 |
-
|
132 |
|
133 |
|
134 |
demo = gr.TabbedInterface(
|
135 |
|
136 |
-
[txtgen_iface, sum_iface, med_iface
|
137 |
title="All the Models of UWC",
|
138 |
|
139 |
)
|
|
|
106 |
med_iface = gr.Interface(fn=ner_drugs,inputs = "text",outputs=["text"],title="Drugs Named Entity Recognition").queue()
|
107 |
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
|
111 |
demo = gr.TabbedInterface(
|
112 |
|
113 |
+
[txtgen_iface, sum_iface, med_iface], ["Text Generation", "Summary Generation", "Drug Named-entity recognition"],
|
114 |
title="All the Models of UWC",
|
115 |
|
116 |
)
|