mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-01-26 19:09:45 +00:00
[Space] Add the ability to reinstall requirements specifically (#1783)
* reinstall * force_download=False
This commit is contained in:
@@ -116,13 +116,15 @@ class ForgeSpace:
|
|||||||
results = []
|
results = []
|
||||||
|
|
||||||
installed = os.path.exists(self.hf_path)
|
installed = os.path.exists(self.hf_path)
|
||||||
|
requirements_filename = os.path.abspath(os.path.realpath(os.path.join(self.root_path, 'requirements.txt')))
|
||||||
|
has_requirement = os.path.exists(requirements_filename)
|
||||||
|
|
||||||
if isinstance(self.gradio_metas, tuple):
|
if isinstance(self.gradio_metas, tuple):
|
||||||
results.append(build_html(title=self.title, installed=installed, url=self.gradio_metas[1]))
|
results.append(build_html(title=self.title, installed=installed, url=self.gradio_metas[1]))
|
||||||
else:
|
else:
|
||||||
results.append(build_html(title=self.title, installed=installed, url=None))
|
results.append(build_html(title=self.title, installed=installed, url=None))
|
||||||
|
|
||||||
results.append(gr.update(interactive=not self.is_running and not installed))
|
results.append(gr.update(interactive=not self.is_running and not (installed and not has_requirement), value=("Reinstall" if (installed and has_requirement) else "Install")))
|
||||||
results.append(gr.update(interactive=not self.is_running and installed))
|
results.append(gr.update(interactive=not self.is_running and installed))
|
||||||
results.append(gr.update(interactive=installed and not self.is_running))
|
results.append(gr.update(interactive=installed and not self.is_running))
|
||||||
results.append(gr.update(interactive=installed and self.is_running))
|
results.append(gr.update(interactive=installed and self.is_running))
|
||||||
@@ -137,7 +139,7 @@ class ForgeSpace:
|
|||||||
repo_type=self.repo_type,
|
repo_type=self.repo_type,
|
||||||
revision=self.revision,
|
revision=self.revision,
|
||||||
local_dir=self.hf_path,
|
local_dir=self.hf_path,
|
||||||
force_download=True,
|
force_download=False,
|
||||||
allow_patterns=self.allow_patterns,
|
allow_patterns=self.allow_patterns,
|
||||||
ignore_patterns=self.ignore_patterns
|
ignore_patterns=self.ignore_patterns
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user