File size: 1,202 Bytes
5c4a11c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e5f9b65
54ad002
5c4a11c
 
 
 
54ad002
 
5c4a11c
54ad002
 
 
 
 
 
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
36
37
38
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
from huggingface_hub import hf_hub_url, cached_download

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

REPO_ID = "RamAnanth1/videocrafter-text2video"
ckpt_path = cached_download(hf_hub_url(REPO_ID, 'model.ckpt'))
# # get model & sampler
model, _, _ = load_model(config, ckpt_path, 
                         inject_lora=opt.inject_lora, 
                         lora_scale=opt.lora_scale, 
                         lora_path=opt.lora_path
                         )
ddim_sampler = DDIMSampler(model)

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

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