Untitled

 avatar
unknown
plain_text
2 years ago
1.8 kB
19
Indexable
@echo off

cd /D "%~dp0"

set MAMBA_ROOT_PREFIX=%cd%\installer_files\mamba
set INSTALL_ENV_DIR=%cd%\installer_files\env

if not exist "%MAMBA_ROOT_PREFIX%\condabin\micromamba.bat" (
  call "%MAMBA_ROOT_PREFIX%\micromamba.exe" shell hook >nul 2>&1
)
call "%MAMBA_ROOT_PREFIX%\condabin\micromamba.bat" activate "%INSTALL_ENV_DIR%" || ( echo MicroMamba hook not found. && goto end )
cd text-generation-webui

setlocal EnableDelayedExpansion
set /A count=0

echo Available model directories:
for /D %%d in (models\*) do (
  set /A count+=1
  echo !count!. %%~nxd
)

echo.
set /P selection=Enter the number corresponding to the desired model directory: 
if %selection% GTR %count% (
  echo Invalid selection. Exiting.
  goto end
)

set /A index=0
for /D %%d in (models\*) do (
  set /A index+=1
  if !index! EQU %selection% (
    set model_dir=%%~nxd
    goto selected
  )
)
:selected

set /P wbits=Enter the value for --wbits (press Enter to remove wbits from the command line): 
if "%wbits%" NEQ "" (
  set wbits=--wbits %wbits%
) else (
  set wbits=
)

set /P groupsize=Enter the value for --groupsize (press Enter to remove groupsize from the command line): 
if "%groupsize%" NEQ "" (
  set groupsize=--groupsize %groupsize%
) else (
  set groupsize=
)

set /P pre_layer=Enter the value for --pre_layer (press Enter to remove pre_layer from the command line): 
if "%pre_layer%" NEQ "" (
  set /A pre_layer=%pre_layer%
  if !pre_layer! GTR 40 (
    echo Invalid number. Please enter a number between 1 and 40.
    goto end
  )
  set pre_layer=--pre_layer %pre_layer%
) else (
  set pre_layer=
)

echo.
echo Summary of your choices:
echo Group size: %groupsize%
echo Bits: %wbits%
echo Pre-layer: %pre_layer%
echo.
echo Launching the webui.
echo.

call python server.py --model %model_dir% %wbits% %groupsize% %pre_layer%
:end
pause
Editor is loading...