Spaces:
Runtime error
Runtime error
RamAnanth1
commited on
Commit
β’
5c4a11c
1
Parent(s):
ab40fb9
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
import time
|
4 |
+
import argparse
|
5 |
+
import yaml, math
|
6 |
+
from tqdm import trange
|
7 |
+
import torch
|
8 |
+
import numpy as np
|
9 |
+
from omegaconf import OmegaConf
|
10 |
+
import torch.distributed as dist
|
11 |
+
from pytorch_lightning import seed_everything
|
12 |
+
|
13 |
+
from lvdm.samplers.ddim import DDIMSampler
|
14 |
+
from lvdm.utils.common_utils import str2bool
|
15 |
+
from lvdm.utils.dist_utils import setup_dist, gather_data
|
16 |
+
from lvdm.utils.saving_utils import npz_to_video_grid, npz_to_imgsheet_5d
|
17 |
+
from scripts.sample_utils import load_model, get_conditions, make_model_input_shape, torch_to_np
|
18 |
+
|
19 |
+
config_path = "model_config.yaml"
|
20 |
+
config = OmegaConf.load(config_path)
|
21 |
+
|
22 |
+
# # get model & sampler
|
23 |
+
# model, _, _ = load_model(config, opt.ckpt_path,
|
24 |
+
# inject_lora=opt.inject_lora,
|
25 |
+
# lora_scale=opt.lora_scale,
|
26 |
+
# lora_path=opt.lora_path
|
27 |
+
# )
|
28 |
+
# ddim_sampler = DDIMSampler(model) if opt.sample_type == "ddim" else None
|
29 |
+
|
30 |
+
def greet(name):
|
31 |
+
return "Hello " + name + "!!"
|
32 |
+
|
33 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
34 |
+
iface.launch()
|