File size: 1,091 Bytes
5c4a11c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e5f9b65
5c4a11c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import gradio as gr
import os
import time
import argparse
import yaml, math
from tqdm import trange
import torch
import numpy as np
from omegaconf import OmegaConf
import torch.distributed as dist
from pytorch_lightning import seed_everything

from lvdm.samplers.ddim import DDIMSampler
from lvdm.utils.common_utils import str2bool
from lvdm.utils.dist_utils import setup_dist, gather_data
from lvdm.utils.saving_utils import npz_to_video_grid, npz_to_imgsheet_5d
from utils import load_model, get_conditions, make_model_input_shape, torch_to_np

config_path = "model_config.yaml"
config = OmegaConf.load(config_path)

# # get model & sampler
# model, _, _ = load_model(config, opt.ckpt_path, 
#                          inject_lora=opt.inject_lora, 
#                          lora_scale=opt.lora_scale, 
#                          lora_path=opt.lora_path
#                          )
# ddim_sampler = DDIMSampler(model) if opt.sample_type == "ddim" else None

def greet(name):
    return "Hello " + name + "!!"

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()