Parcourir la source

move model fix

josh il y a 5 mois
Parent
commit
ce9231ad3d
3 fichiers modifiés avec 12 ajouts et 11 suppressions
  1. 8 7
      exo/download/hf/hf_helpers.py
  2. 3 3
      scripts/build_exo.py
  3. 1 1
      setup.py

+ 8 - 7
exo/download/hf/hf_helpers.py

@@ -110,13 +110,14 @@ async def move_models_to_hf(seed_dir: Union[str, Path]):
   source_dir = Path(seed_dir)
   dest_dir = get_hf_home()/"hub"
   await aios.makedirs(dest_dir, exist_ok=True)
-  async for path in source_dir.iterdir():
-    if path.is_dir() and path.startswith("models--"):
-      dest_path = dest_dir / path.name
-      if dest_path.exists():
-        if DEBUG>=1: print(f"skipping moving {dest_path}. File already exists")
-      else:
-        await aios.rename(str(path), str(dest_path))
+  for path in source_dir.iterdir():
+    if path.is_dir() and path.name.startswith("models--"):
+        dest_path = dest_dir / path.name
+        if dest_path.exists():
+            if DEBUG >= 1:
+                print(f"skipping moving {dest_path}. File already exists")
+        else:
+            await aios.rename(str(path), str(dest_path))
         
 
 async def fetch_file_list(session, repo_id, revision, path=""):

+ 3 - 3
scripts/build_exo.py

@@ -2,8 +2,6 @@ import site
 import subprocess
 import sys
 import os 
-import pkgutil
-
 def run():
     site_packages = site.getsitepackages()[0]
     command = [
@@ -24,6 +22,7 @@ def run():
             "--macos-app-mode=gui",
             "--macos-app-version=0.0.1",
             "--macos-signed-app-name=com.exolabs.exo",
+            "--macos-sign-notarization",
             "--include-distribution-meta=mlx",
             "--include-module=mlx._reprlib_fix",
             "--include-module=mlx._os_warning",
@@ -33,7 +32,7 @@ def run():
             "--nofollow-import-to=tinygrad"
         ])
         inference_modules = [
-            name for _, name, _ in pkgutil.iter_modules(['exo/inference/mlx/models'])
+            name for _, name, _ in pkgutil.iter_modules(['exo/inference/models'])
         ]
         for module in inference_modules:
             command.append(f"--include-module=exo.inference.mlx.models.{module}")
@@ -48,6 +47,7 @@ def run():
             "--include-distribution-metadata=pygments",
             "--linux-icon=docs/exo-rounded.png"
         ])
+
     try:
         subprocess.run(command, check=True)
         print("Build completed!")

+ 1 - 1
setup.py

@@ -24,7 +24,7 @@ install_requires = [
   "rich==13.7.1",
   "tenacity==9.0.0",
   "tqdm==4.66.4",
-  "transformers==4.46.3",
+  "transformers==4.43.3",
   "uuid==1.30",
   "tinygrad @ git+https://github.com/tinygrad/tinygrad.git@232edcfd4f8b388807c64fb1817a7668ce27cbad",
 ]