mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +01: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}..."
|
||||
clone_output = subprocess.check_output(["git", "clone", github_url, repo_path], stderr=subprocess.STDOUT)
|
||||
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 "Done."
|
||||
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.")
|
||||
return clone_output.decode()
|
||||
except subprocess.CalledProcessError as 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_status = gr.Markdown()
|
||||
|
||||
extension_name.submit(
|
||||
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'))
|
||||
extension_name.submit(clone_or_pull_repository, extension_name, extension_status, show_progress=False)
|
||||
|
||||
# Reset interface event
|
||||
shared.gradio['reset_interface'].click(
|
||||
|
Loading…
Reference in New Issue
Block a user