mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-02-04 15:09:56 +00:00
revise space
This commit is contained in:
@@ -131,26 +131,17 @@ class ForgeSpace:
|
||||
def install(self):
|
||||
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(
|
||||
repo_id=self.repo_id,
|
||||
repo_type=self.repo_type,
|
||||
revision=self.revision,
|
||||
local_dir=self.hf_path,
|
||||
force_download=True,
|
||||
allow_patterns=self.allow_patterns,
|
||||
ignore_patterns=self.ignore_patterns
|
||||
)
|
||||
|
||||
print(f'Downloaded: {downloaded}')
|
||||
if self.repo_id is not None:
|
||||
downloaded = snapshot_download(
|
||||
repo_id=self.repo_id,
|
||||
repo_type=self.repo_type,
|
||||
revision=self.revision,
|
||||
local_dir=self.hf_path,
|
||||
force_download=True,
|
||||
allow_patterns=self.allow_patterns,
|
||||
ignore_patterns=self.ignore_patterns
|
||||
)
|
||||
print(f'Downloaded: {downloaded}')
|
||||
|
||||
requirements_filename = os.path.abspath(os.path.realpath(os.path.join(self.root_path, 'requirements.txt')))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user