Spaces:
Running
on
Zero
Running
on
Zero
- scripts/anime.py +1 -0
- scripts/generate_prompt.py +1 -0
- scripts/process_utils.py +1 -0
scripts/anime.py
CHANGED
@@ -19,6 +19,7 @@ import spaces
|
|
19 |
model = None
|
20 |
device = None
|
21 |
|
|
|
22 |
def init_model(use_local=False):
|
23 |
global model, device
|
24 |
model_opt = "default"
|
|
|
19 |
model = None
|
20 |
device = None
|
21 |
|
22 |
+
@spaces.GPU
|
23 |
def init_model(use_local=False):
|
24 |
global model, device
|
25 |
model_opt = "default"
|
scripts/generate_prompt.py
CHANGED
@@ -41,6 +41,7 @@ def download_model_files(repo_id, model_dir, sub_dir, files, sub_files):
|
|
41 |
for file in sub_files:
|
42 |
hf_hub_download(repo_id, file, subfolder=sub_dir, cache_dir=os.path.join(model_dir, sub_dir), force_download=True, force_filename=file)
|
43 |
|
|
|
44 |
def load_wd14_tagger_model():
|
45 |
"""WD14γΏγ°δ»γγ’γγ«γγγΌγ"""
|
46 |
model_dir = "wd14_tagger_model"
|
|
|
41 |
for file in sub_files:
|
42 |
hf_hub_download(repo_id, file, subfolder=sub_dir, cache_dir=os.path.join(model_dir, sub_dir), force_download=True, force_filename=file)
|
43 |
|
44 |
+
@spaces.GPU
|
45 |
def load_wd14_tagger_model():
|
46 |
"""WD14γΏγ°δ»γγ’γγ«γγγΌγ"""
|
47 |
model_dir = "wd14_tagger_model"
|
scripts/process_utils.py
CHANGED
@@ -35,6 +35,7 @@ def ensure_rgb(image):
|
|
35 |
return image.convert('RGB')
|
36 |
return image
|
37 |
|
|
|
38 |
def initialize(_use_local=False, use_gpu=False, use_dotenv=False):
|
39 |
if use_dotenv:
|
40 |
load_dotenv()
|
|
|
35 |
return image.convert('RGB')
|
36 |
return image
|
37 |
|
38 |
+
@spaces.GPU
|
39 |
def initialize(_use_local=False, use_gpu=False, use_dotenv=False):
|
40 |
if use_dotenv:
|
41 |
load_dotenv()
|