This commit is contained in:
Yuwei Guo
2023-07-20 11:23:05 +08:00
parent 5ce0970795
commit e73420a4d7

22
app.py
View File

@@ -1,4 +1,3 @@
import os import os
import torch import torch
import random import random
@@ -74,6 +73,27 @@ examples = [
] ]
] ]
# clean unrelated ckpts
ckpts = [
"realisticVisionV20_v20.safetensors",
"majicmixRealistic_v5Preview.safetensors",
"rcnzCartoon3d_v10.safetensors",
"lyriel_v16.safetensors",
"toonyou_beta3.safetensors"
]
for path in glob(os.path.join("models", "DreamBooth_LoRA", "*.safetensors")):
for ckpt in ckpts:
if path.endswith(ckpt): break
else:
print(f"### Cleaning {path} ...")
os.system(f"rm -rf {path}")
# clean Grdio cache
print(f"### Cleaning cached examples ...")
os.system(f"rm -rf gradio_cached_examples/")
class AnimateController: class AnimateController:
def __init__(self): def __init__(self):