[object Object]

← back to Exo

fixes

9a6af743ad087573e3455a2f96e3dded90565cdf · 2024-11-21 05:34:28 -0800 · josh

Files touched

Diff

commit 9a6af743ad087573e3455a2f96e3dded90565cdf
Author: josh <eyasufikru567@gmail.com>
Date:   Thu Nov 21 05:34:28 2024 -0800

    fixes
---
 exo/download/hf/hf_helpers.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/exo/download/hf/hf_helpers.py b/exo/download/hf/hf_helpers.py
index 6f27329a..a62dac0d 100644
--- a/exo/download/hf/hf_helpers.py
+++ b/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=""):

← 5269629d removed unused code  ·  back to Exo  ·  defining optional 1ca11ead →