Basic changes

This commit is contained in:
oobabooga 2023-09-21 15:42:37 -07:00
parent b04b3957f9
commit fc2b831692

View File

@ -112,16 +112,12 @@ def install_dependencies():
else:
run_cmd("conda install -y -k ninja git && python -m pip install torch torchvision torchaudio", assert_success=True, environment=True)
# Clone webui to our computer
run_cmd("git clone https://github.com/oobabooga/text-generation-webui.git", assert_success=True, environment=True)
# Install the webui dependencies
update_dependencies(initial_installation=True)
def update_dependencies(initial_installation=False):
os.chdir("text-generation-webui")
run_cmd("git pull", assert_success=True, environment=True)
# run_cmd("git pull", assert_success=True, environment=True) # TODO uncomment before merging (is there a better way?)
# Install the extensions dependencies (only on the first install)
if initial_installation:
@ -215,12 +211,10 @@ def update_dependencies(initial_installation=False):
def download_model():
os.chdir("text-generation-webui")
run_cmd("python download-model.py", environment=True)
def launch_webui():
os.chdir("text-generation-webui")
run_cmd(f"python server.py {CMD_FLAGS}", environment=True)
@ -236,7 +230,8 @@ if __name__ == "__main__":
update_dependencies()
else:
# If webui has already been installed, skip and run
if not os.path.exists("text-generation-webui/"):
# if not os.path.exists("text-generation-webui/"):
if True: # TODO implement a new installation check
install_dependencies()
os.chdir(script_dir)