Team Ai
Apppublic

KBaba7/llama.cpp

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
chat-13B.bat58 linesDownload Raw Back to examples
1@setlocal disabledelayedexpansion enableextensions2@echo off3 4cd /d "%~dp0.."5if not "%errorlevel%"=="0" (6    echo Unable to change directory.7    pause8    exit /b 19)10 11if not defined MODEL set "MODEL=models\13B\ggml-model-q4_0.bin"12if not defined USER_NAME set "USER_NAME=User"13if not defined AI_NAME set "AI_NAME=ChatLLaMa"14rem Adjust to the number of CPU cores you want to use.15rem if not defined N_THREAD set "N_THREAD=8"16rem Number of tokens to predict (made it larger than default because we want a long interaction)17if not defined N_PREDICTS set "N_PREDICTS=2048"18if not defined GEN_OPTIONS set "GEN_OPTIONS=--ctx_size 2048 --temp 0.7 --top_k 40 --top_p 0.5 --repeat_last_n 256 --batch_size 1024 --repeat_penalty 1.17647"19 20rem Default main script paths21set "DEFAULT_MAIN_SCRIPT_PATHS=main.exe build\bin\main.exe"22 23rem Get main script path from command line arguments24set "MAIN_SCRIPT_PATH=%~1"25 26rem If the main script path was not specified, try the default paths27if not defined MAIN_SCRIPT_PATH (28    for %%i in (%DEFAULT_MAIN_SCRIPT_PATHS%) do (29        if exist "%%i" set "MAIN_SCRIPT_PATH=%%i"30    )31)32 33rem If the main script path was not found, tell the user how to specify it34if not defined MAIN_SCRIPT_PATH (35    echo The main script could not be found. Please provide the path to the main script as 1st argument to this script, or place the main script in one of the default locations:36    echo %DEFAULT_MAIN_SCRIPT_PATHS%37    pause38    exit /b 139)40 41rem Default context, feel free to edit it42set "PROMPT_TEXT=Text transcript of a never ending dialog, where %USER_NAME% interacts with an AI assistant named %AI_NAME%. %AI_NAME% is helpful, kind, honest, friendly, good at writing and never fails to answer %USER_NAME%'s requests immediately and with details and precision. There are no annotations like (30 seconds passed...) or (to himself), just what %USER_NAME% and %AI_NAME% say aloud to each other. The dialog lasts for years, the entirety of it is shared below. It's 10000 pages long. The transcript only includes text, it does not include markup like HTML and Markdown."43 44rem Set a temporary variable if N_THREAD is set45if defined N_THREAD (46    set "_N_THREAD=--threads %N_THREAD%"47) else (48    set "_N_THREAD="49)50 51rem Run the script52echo "%MAIN_SCRIPT_PATH%" %GEN_OPTIONS% %_N_THREAD% ^53  --model "%MODEL%" ^54  --n_predict %N_PREDICTS% ^55  --color --interactive ^56  --reverse-prompt "%USER_NAME%:" ^57  --prompt "%PROMPT_TEXT%"58