Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -141,6 +141,22 @@ CSS = """
|
|
| 141 |
|
| 142 |
@spaces.GPU
|
| 143 |
def generate_video_from_text(text, opt, pipeline):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
width = 500
|
| 145 |
height = 500
|
| 146 |
texts = [text, text]
|
|
|
|
| 141 |
|
| 142 |
@spaces.GPU
|
| 143 |
def generate_video_from_text(text, opt, pipeline):
|
| 144 |
+
global edit_config
|
| 145 |
+
|
| 146 |
+
gr.Info("Loading Configurations...", duration = 3)
|
| 147 |
+
model = build_models(opt, edit_config=edit_config)
|
| 148 |
+
ckpt_path = pjoin(opt.model_dir, opt.which_ckpt + '.tar')
|
| 149 |
+
niter = load_model_weights(model, ckpt_path, use_ema=not opt.no_ema)
|
| 150 |
+
|
| 151 |
+
pipeline = DiffusePipeline(
|
| 152 |
+
opt = opt,
|
| 153 |
+
model = model,
|
| 154 |
+
diffuser_name = opt.diffuser_name,
|
| 155 |
+
device=opt.device,
|
| 156 |
+
num_inference_steps=opt.num_inference_steps,
|
| 157 |
+
torch_dtype=torch.float16,
|
| 158 |
+
)
|
| 159 |
+
|
| 160 |
width = 500
|
| 161 |
height = 500
|
| 162 |
texts = [text, text]
|