Spaces:
Runtime error
Runtime error
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=False, | |
lora_scale=None, | |
) | |
ddim_sampler = DDIMSampler(model) | |
def greet(name): | |
return "Hello " + name + "!!" | |
iface = gr.Interface(fn=greet, inputs="text", outputs="text") | |
iface.launch() | |