space requirement (#1721)

This commit is contained in:
Haoming
2024-09-07 11:45:51 +08:00
committed by GitHub
parent 3dd5e19c83
commit 68559eb180

View File

@@ -132,6 +132,12 @@ class ForgeSpace:
os.makedirs(self.hf_path, exist_ok=True)
if self.repo_id is None:
requirements_filename = os.path.abspath(os.path.realpath(os.path.join(self.root_path, 'requirements.txt')))
if os.path.exists(requirements_filename):
from modules.launch_utils import run_pip
run_pip(f'install -r "{requirements_filename}"', desc=f"space requirements for [{self.title}]")
return self.refresh_gradio()
downloaded = snapshot_download(