Spaces:
Runtime error
Runtime error
load models from hub
Browse files- interface/app.py +10 -7
interface/app.py
CHANGED
@@ -1,20 +1,23 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
from .model_loader import Model
|
4 |
from PIL import Image
|
5 |
import cv2
|
6 |
import io
|
|
|
|
|
|
|
|
|
7 |
|
8 |
# models fron pretrained/latent_transformer folder
|
9 |
models_files = {
|
10 |
-
"anime": "
|
11 |
-
"car": "
|
12 |
-
"cat": "
|
13 |
-
"church": "
|
14 |
-
"ffhq": "
|
15 |
}
|
16 |
|
17 |
-
models = {name: Model(path) for name, path in models_files.items()}
|
18 |
|
19 |
|
20 |
def cv_to_pil(img):
|
|
|
1 |
import gradio as gr
|
|
|
2 |
from .model_loader import Model
|
3 |
from PIL import Image
|
4 |
import cv2
|
5 |
import io
|
6 |
+
from huggingface_hub import snapshot_download
|
7 |
+
|
8 |
+
models_path = snapshot_download(repo_id="radames/UserControllableLT", repo_type="model")
|
9 |
+
|
10 |
|
11 |
# models fron pretrained/latent_transformer folder
|
12 |
models_files = {
|
13 |
+
"anime": "anime.pt",
|
14 |
+
"car": "car.pt",
|
15 |
+
"cat": "cat.pt",
|
16 |
+
"church": "church.pt",
|
17 |
+
"ffhq": "ffhq.pt",
|
18 |
}
|
19 |
|
20 |
+
models = {name: Model(models_path + "/" + path) for name, path in models_files.items()}
|
21 |
|
22 |
|
23 |
def cv_to_pil(img):
|