mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Allow start scripts to have command-line flags
This commit is contained in:
parent
8ab3eca9ec
commit
3314b7d795
@ -1 +0,0 @@
|
|||||||
--listen
|
|
@ -64,4 +64,4 @@ source "$CONDA_ROOT_PREFIX/etc/profile.d/conda.sh" # otherwise conda complains a
|
|||||||
conda activate "$INSTALL_ENV_DIR"
|
conda activate "$INSTALL_ENV_DIR"
|
||||||
|
|
||||||
# setup installer env
|
# setup installer env
|
||||||
python webui.py
|
python webui.py $@
|
||||||
|
@ -64,4 +64,4 @@ source "$CONDA_ROOT_PREFIX/etc/profile.d/conda.sh" # otherwise conda complains a
|
|||||||
conda activate "$INSTALL_ENV_DIR"
|
conda activate "$INSTALL_ENV_DIR"
|
||||||
|
|
||||||
# setup installer env
|
# setup installer env
|
||||||
python webui.py
|
python webui.py $@
|
||||||
|
@ -67,7 +67,7 @@ set "CUDA_HOME=%CUDA_PATH%"
|
|||||||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end )
|
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end )
|
||||||
|
|
||||||
@rem setup installer env
|
@rem setup installer env
|
||||||
call python webui.py
|
call python webui.py %*
|
||||||
|
|
||||||
@rem below are functions for the script next line skips these during normal execution
|
@rem below are functions for the script next line skips these during normal execution
|
||||||
goto end
|
goto end
|
||||||
|
@ -5,7 +5,7 @@ cd /D "%~dp0"
|
|||||||
set PATH=%PATH%;%SystemRoot%\system32
|
set PATH=%PATH%;%SystemRoot%\system32
|
||||||
|
|
||||||
@rem sed -i 's/\x0D$//' ./wsl.sh converts newlines to unix format in the wsl script
|
@rem sed -i 's/\x0D$//' ./wsl.sh converts newlines to unix format in the wsl script
|
||||||
call wsl -e bash -lic "sed -i 's/\x0D$//' ./wsl.sh; source ./wsl.sh"
|
call wsl -e bash -lic "sed -i 's/\x0D$//' ./wsl.sh; source ./wsl.sh $@"
|
||||||
|
|
||||||
:end
|
:end
|
||||||
pause
|
pause
|
||||||
|
5
webui.py
5
webui.py
@ -245,7 +245,8 @@ def download_model():
|
|||||||
|
|
||||||
|
|
||||||
def launch_webui():
|
def launch_webui():
|
||||||
run_cmd(f"python server.py {CMD_FLAGS}", environment=True)
|
flags = [flag for flag in sys.argv[1:] if flag != '--update']
|
||||||
|
run_cmd(f"python server.py {' '.join(flags)} {CMD_FLAGS}", environment=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@ -254,7 +255,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--update', action='store_true', help='Update the web UI.')
|
parser.add_argument('--update', action='store_true', help='Update the web UI.')
|
||||||
args = parser.parse_args()
|
args, _ = parser.parse_known_args()
|
||||||
|
|
||||||
if args.update:
|
if args.update:
|
||||||
update_dependencies()
|
update_dependencies()
|
||||||
|
2
wsl.sh
2
wsl.sh
@ -106,5 +106,5 @@ fi
|
|||||||
# setup installer env update env if called with 'wsl.sh update'
|
# setup installer env update env if called with 'wsl.sh update'
|
||||||
case "$1" in
|
case "$1" in
|
||||||
("update") python webui.py --update;;
|
("update") python webui.py --update;;
|
||||||
(*) python webui.py;;
|
(*) python webui.py $@;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user