Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,4 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import torch
|
3 |
-
|
4 |
-
from syngen_diffusion_pipeline import SynGenDiffusionPipeline
|
5 |
-
|
6 |
import subprocess
|
7 |
-
|
8 |
def install_spacy_model(model_name):
|
9 |
try:
|
10 |
subprocess.check_call(["python", "-m", "spacy", "download", model_name])
|
@@ -14,6 +8,15 @@ def install_spacy_model(model_name):
|
|
14 |
|
15 |
install_spacy_model("en_core_web_trf")
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
model_path = 'CompVis/stable-diffusion-v1-4'
|
18 |
device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu')
|
19 |
pipe = SynGenDiffusionPipeline.from_pretrained(model_path).to(device)
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import subprocess
|
|
|
2 |
def install_spacy_model(model_name):
|
3 |
try:
|
4 |
subprocess.check_call(["python", "-m", "spacy", "download", model_name])
|
|
|
8 |
|
9 |
install_spacy_model("en_core_web_trf")
|
10 |
|
11 |
+
import gradio as gr
|
12 |
+
import torch
|
13 |
+
|
14 |
+
from syngen_diffusion_pipeline import SynGenDiffusionPipeline
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
model_path = 'CompVis/stable-diffusion-v1-4'
|
21 |
device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu')
|
22 |
pipe = SynGenDiffusionPipeline.from_pretrained(model_path).to(device)
|