mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Extension install improvements
This commit is contained in:
parent
7f1460af29
commit
814520fed1
@ -34,8 +34,7 @@ def clone_or_pull_repository(github_url):
|
|||||||
yield f"Cloning {github_url}..."
|
yield f"Cloning {github_url}..."
|
||||||
clone_output = subprocess.check_output(["git", "clone", github_url, repo_path], stderr=subprocess.STDOUT)
|
clone_output = subprocess.check_output(["git", "clone", github_url, repo_path], stderr=subprocess.STDOUT)
|
||||||
new_extensions.add(repo_name)
|
new_extensions.add(repo_name)
|
||||||
logger.info(f"The extension {repo_name} has been downloaded. Please close the the web UI and launch it again to be able to load it.")
|
yield(f"The extension `{repo_name}` has been downloaded.\n\nPlease close the the web UI completely and launch it again to be able to load it.")
|
||||||
yield "Done."
|
|
||||||
return clone_output.decode()
|
return clone_output.decode()
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
return str(e)
|
return str(e)
|
||||||
|
@ -25,9 +25,7 @@ def create_ui():
|
|||||||
extension_name = gr.Textbox(lines=1, label='Install or update an extension', info='Enter the GitHub URL below and press Enter. For a list of extensions, see: https://github.com/oobabooga/text-generation-webui-extensions ⚠️ WARNING ⚠️ : extensions can execute arbitrary code. Make sure to inspect their source code before activating them.')
|
extension_name = gr.Textbox(lines=1, label='Install or update an extension', info='Enter the GitHub URL below and press Enter. For a list of extensions, see: https://github.com/oobabooga/text-generation-webui-extensions ⚠️ WARNING ⚠️ : extensions can execute arbitrary code. Make sure to inspect their source code before activating them.')
|
||||||
extension_status = gr.Markdown()
|
extension_status = gr.Markdown()
|
||||||
|
|
||||||
extension_name.submit(
|
extension_name.submit(clone_or_pull_repository, extension_name, extension_status, show_progress=False)
|
||||||
clone_or_pull_repository, extension_name, extension_status, show_progress=False).then(
|
|
||||||
lambda: gr.update(choices=utils.get_available_extensions(), value=shared.args.extensions), None, gradio('extensions_menu'))
|
|
||||||
|
|
||||||
# Reset interface event
|
# Reset interface event
|
||||||
shared.gradio['reset_interface'].click(
|
shared.gradio['reset_interface'].click(
|
||||||
|
Loading…
Reference in New Issue
Block a user