build error fix

This commit is contained in:
josh
2024-11-19 20:34:48 -08:00
parent f337e78119
commit 44118252e9

View File

@@ -3,6 +3,7 @@ import subprocess
import sys import sys
import os import os
import pkgutil import pkgutil
import shutil
def run(): def run():
site_packages = site.getsitepackages()[0] site_packages = site.getsitepackages()[0]
@@ -14,7 +15,6 @@ def run():
"--follow-imports", "--follow-imports",
"--standalone", "--standalone",
"--output-filename=exo", "--output-filename=exo",
"--onefile",
"--python-flag=no_site" "--python-flag=no_site"
] ]
@@ -48,9 +48,10 @@ def run():
"--include-distribution-metadata=pygments", "--include-distribution-metadata=pygments",
"--linux-icon=docs/exo-rounded.png" "--linux-icon=docs/exo-rounded.png"
]) ])
try: try:
subprocess.run(command, check=True) subprocess.run(command, check=True)
os.makedirs('./dist/main.dist/transformers/models', exist_ok=True)
shutil.copytree(f"{site_packages}/transformers/models", "dist/main.dist/transformers/models")
print("Build completed!") print("Build completed!")
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f"An error occurred: {e}") print(f"An error occurred: {e}")