josh 8 달 전
부모
커밋
9a6af743ad
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      exo/download/hf/hf_helpers.py

+ 5 - 4
exo/download/hf/hf_helpers.py

@@ -108,14 +108,15 @@ async def move_models_to_hf(seed_dir: Union[str, Path]):
   """Move model in resources folder of app to .cache/huggingface/hub"""
   source_dir = Path(seed_dir)
   dest_dir = get_hf_home()/"hub"
-  await aios.makedirs(dest_dir, exist_ok=True)   
-  async for path in await aios.listdir(source_dir):
-    if await path.is_dir() and path.name.startswith("models--"):
+  await aios.makedirs(dest_dir, exist_ok=True)  
+  for path in source_dir.iterdir():
+    if path.is_dir() and path.name.startswith("models--"):
       dest_path = dest_dir / path.name
       try:
         await aios.rename(str(path), str(dest_path))
       except Exception as e:
-        print(e)
+        print(f'Error moving model to .cache: {e}')
+    
     
 
 async def fetch_file_list(session, repo_id, revision, path=""):