|
@@ -109,12 +109,10 @@ def get_repo_root(repo_id: str) -> Path:
|
|
async def move_models_to_hf(seed_dir: Union[str, Path]):
|
|
async def move_models_to_hf(seed_dir: Union[str, Path]):
|
|
"""Move model in resources folder of app to .cache/huggingface/hub"""
|
|
"""Move model in resources folder of app to .cache/huggingface/hub"""
|
|
source_dir = AsyncPath(seed_dir)
|
|
source_dir = AsyncPath(seed_dir)
|
|
- if DEBUG>=1: print("moving files")
|
|
|
|
dest_dir = AsyncPath(get_hf_home()/"hub")
|
|
dest_dir = AsyncPath(get_hf_home()/"hub")
|
|
await aios.makedirs(dest_dir, exist_ok=True)
|
|
await aios.makedirs(dest_dir, exist_ok=True)
|
|
async for path in source_dir.iterdir():
|
|
async for path in source_dir.iterdir():
|
|
if await path.is_dir() and path.name.startswith("models--"):
|
|
if await path.is_dir() and path.name.startswith("models--"):
|
|
- if DEBUG>=1: print("moving files")
|
|
|
|
dest_path = dest_dir / path.name
|
|
dest_path = dest_dir / path.name
|
|
try:
|
|
try:
|
|
await aios.rename(str(path), str(dest_path))
|
|
await aios.rename(str(path), str(dest_path))
|