Commit 75f56406 authored by wfjsw's avatar wfjsw

Revert Pull Request #11244

Revert "Add github mirror for the download extension"

This reverts commit 9ec2ba2d.

Revert "Update code style"

This reverts commit de022c4c.

Revert "Update call method"

This reverts commit e9bd18c5.

Revert "move github proxy to settings, System page."

This reverts commit 4981c7d3.
parent bcb6ad5f
...@@ -391,7 +391,6 @@ options_templates.update(options_section(('system', "System"), { ...@@ -391,7 +391,6 @@ options_templates.update(options_section(('system', "System"), {
"print_hypernet_extra": OptionInfo(False, "Print extra hypernetwork information to console."), "print_hypernet_extra": OptionInfo(False, "Print extra hypernetwork information to console."),
"list_hidden_files": OptionInfo(True, "Load models/files in hidden directories").info("directory is hidden if its name starts with \".\""), "list_hidden_files": OptionInfo(True, "Load models/files in hidden directories").info("directory is hidden if its name starts with \".\""),
"disable_mmap_load_safetensors": OptionInfo(False, "Disable memmapping for loading .safetensors files.").info("fixes very slow loading speed in some cases"), "disable_mmap_load_safetensors": OptionInfo(False, "Disable memmapping for loading .safetensors files.").info("fixes very slow loading speed in some cases"),
"github_proxy": OptionInfo("None", "Github proxy", ui_components.DropdownEditable, lambda: {"choices": ["None", "ghproxy.com", "hub.yzuu.cf", "hub.njuu.cf", "hub.nuaa.cf"]}).info("for custom inputs will just replace github.com with the input"),
})) }))
options_templates.update(options_section(('training', "Training"), { options_templates.update(options_section(('training', "Training"), {
......
...@@ -325,17 +325,6 @@ def normalize_git_url(url): ...@@ -325,17 +325,6 @@ def normalize_git_url(url):
return url return url
def github_proxy(url):
proxy = shared.opts.github_proxy
if proxy == 'None':
return url
if proxy == 'ghproxy.com':
return "https://ghproxy.com/" + url
return url.replace('github.com', proxy)
def install_extension_from_url(dirname, url, branch_name=None): def install_extension_from_url(dirname, url, branch_name=None):
check_access() check_access()
...@@ -346,8 +335,6 @@ def install_extension_from_url(dirname, url, branch_name=None): ...@@ -346,8 +335,6 @@ def install_extension_from_url(dirname, url, branch_name=None):
assert url, 'No URL specified' assert url, 'No URL specified'
url = github_proxy(url)
if dirname is None or dirname == "": if dirname is None or dirname == "":
*parts, last_part = url.split('/') *parts, last_part = url.split('/')
last_part = normalize_git_url(last_part) last_part = normalize_git_url(last_part)
...@@ -367,12 +354,12 @@ def install_extension_from_url(dirname, url, branch_name=None): ...@@ -367,12 +354,12 @@ def install_extension_from_url(dirname, url, branch_name=None):
shutil.rmtree(tmpdir, True) shutil.rmtree(tmpdir, True)
if not branch_name: if not branch_name:
# if no branch is specified, use the default branch # if no branch is specified, use the default branch
with git.Repo.clone_from(url, tmpdir, filter=['blob:none'], verbose=False) as repo: with git.Repo.clone_from(url, tmpdir, filter=['blob:none']) as repo:
repo.remote().fetch() repo.remote().fetch()
for submodule in repo.submodules: for submodule in repo.submodules:
submodule.update() submodule.update()
else: else:
with git.Repo.clone_from(url, tmpdir, filter=['blob:none'], branch=branch_name, verbose=False) as repo: with git.Repo.clone_from(url, tmpdir, filter=['blob:none'], branch=branch_name) as repo:
repo.remote().fetch() repo.remote().fetch()
for submodule in repo.submodules: for submodule in repo.submodules:
submodule.update() submodule.update()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment