Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,13 +16,13 @@ os.system("pip3 install -U numpy")
|
|
| 16 |
|
| 17 |
|
| 18 |
hf_hub_download(repo_id="fun-research/TiTok", filename="maskgit-vqgan-imagenet-f16-256.bin", local_dir="./")
|
| 19 |
-
hf_hub_download(repo_id="yucornetto/RAR", filename="
|
| 20 |
|
| 21 |
# @spaces.GPU
|
| 22 |
def load_model():
|
| 23 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 24 |
# load config
|
| 25 |
-
rar_model_size = "
|
| 26 |
config = demo_util.get_config("configs/training/generator/rar.yaml")
|
| 27 |
config.experiment.generator_checkpoint = f"{rar_model_size}.bin"
|
| 28 |
config.model.generator.hidden_size = {"rar_b": 768, "rar_l": 1024, "rar_xl": 1280, "rar_xxl": 1408}[rar_model_size]
|
|
@@ -67,7 +67,7 @@ def demo_infer(
|
|
| 67 |
return samples
|
| 68 |
|
| 69 |
with gr.Blocks() as demo:
|
| 70 |
-
gr.Markdown("<h1 style='text-align: center'>
|
| 71 |
|
| 72 |
with gr.Tabs():
|
| 73 |
with gr.TabItem('Generate'):
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
hf_hub_download(repo_id="fun-research/TiTok", filename="maskgit-vqgan-imagenet-f16-256.bin", local_dir="./")
|
| 19 |
+
hf_hub_download(repo_id="yucornetto/RAR", filename="rar_xl.bin", local_dir="./")
|
| 20 |
|
| 21 |
# @spaces.GPU
|
| 22 |
def load_model():
|
| 23 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 24 |
# load config
|
| 25 |
+
rar_model_size = "rar_xl"
|
| 26 |
config = demo_util.get_config("configs/training/generator/rar.yaml")
|
| 27 |
config.experiment.generator_checkpoint = f"{rar_model_size}.bin"
|
| 28 |
config.model.generator.hidden_size = {"rar_b": 768, "rar_l": 1024, "rar_xl": 1280, "rar_xxl": 1408}[rar_model_size]
|
|
|
|
| 67 |
return samples
|
| 68 |
|
| 69 |
with gr.Blocks() as demo:
|
| 70 |
+
gr.Markdown("<h1 style='text-align: center'>Randomized Autoregressive Visual Generation (This demo runs with RAR-XL)</h1>")
|
| 71 |
|
| 72 |
with gr.Tabs():
|
| 73 |
with gr.TabItem('Generate'):
|