mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-29 10:59:32 +01:00
Move special character check to start script (#92)
Also port print_big_message function to batch
This commit is contained in:
parent
04cae3e5db
commit
eac8450ef7
@ -6,6 +6,13 @@ set PATH=%PATH%;%SystemRoot%\system32
|
|||||||
|
|
||||||
echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which can not be silently installed under a path with spaces. && goto end
|
echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which can not be silently installed under a path with spaces. && goto end
|
||||||
|
|
||||||
|
@rem Check for special characters in installation path
|
||||||
|
set "SPCHARMESSAGE="WARNING: Special characters were detected in the installation path!" " This can cause the installation to fail!""
|
||||||
|
echo "%CD%"| findstr /R /C:"[!#\$%&()\*+,;<=>?@\[\]\^`{|}~]" >nul && (
|
||||||
|
call :PrintBigMessage %SPCHARMESSAGE%
|
||||||
|
)
|
||||||
|
set SPCHARMESSAGE=
|
||||||
|
|
||||||
@rem fix failed install when installing to a separate drive
|
@rem fix failed install when installing to a separate drive
|
||||||
set TMP=%cd%\installer_files
|
set TMP=%cd%\installer_files
|
||||||
set TEMP=%cd%\installer_files
|
set TEMP=%cd%\installer_files
|
||||||
@ -39,8 +46,8 @@ if "%conda_exists%" == "F" (
|
|||||||
|
|
||||||
@rem create the installer env
|
@rem create the installer env
|
||||||
if not exist "%INSTALL_ENV_DIR%" (
|
if not exist "%INSTALL_ENV_DIR%" (
|
||||||
echo Packages to install: %PACKAGES_TO_INSTALL%
|
echo Packages to install: %PACKAGES_TO_INSTALL%
|
||||||
call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" python=3.10 || ( echo. && echo Conda environment creation failed. && goto end )
|
call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" python=3.10 || ( echo. && echo Conda environment creation failed. && goto end )
|
||||||
)
|
)
|
||||||
|
|
||||||
@rem check if conda environment was actually created
|
@rem check if conda environment was actually created
|
||||||
@ -59,5 +66,16 @@ call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || (
|
|||||||
@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
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:PrintBigMessage
|
||||||
|
echo. && echo.
|
||||||
|
echo *******************************************************************
|
||||||
|
for %%M in (%*) do echo * %%~M
|
||||||
|
echo *******************************************************************
|
||||||
|
echo. && echo.
|
||||||
|
exit /b
|
||||||
|
|
||||||
:end
|
:end
|
||||||
pause
|
pause
|
||||||
|
10
webui.py
10
webui.py
@ -67,16 +67,6 @@ def check_env():
|
|||||||
|
|
||||||
|
|
||||||
def install_dependencies():
|
def install_dependencies():
|
||||||
# Check for special characters in installation path on Windows
|
|
||||||
if sys.platform.startswith("win"):
|
|
||||||
# punctuation contains: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
|
|
||||||
from string import punctuation
|
|
||||||
|
|
||||||
# Allow some characters: _-:\/.'"
|
|
||||||
special_characters = punctuation.translate({ord(char): None for char in '_-:\\/.\'"'})
|
|
||||||
if any(char in script_dir for char in special_characters):
|
|
||||||
print_big_message("WARNING: Special characters were detected in the installation path!\n This can cause the installation to fail!")
|
|
||||||
|
|
||||||
# Select your GPU or, choose to run in CPU mode
|
# Select your GPU or, choose to run in CPU mode
|
||||||
print("What is your GPU")
|
print("What is your GPU")
|
||||||
print()
|
print()
|
||||||
|
Loading…
Reference in New Issue
Block a user