Merge pull request #39 from arroyoquiel/patch-8

Fix for #27
This commit is contained in:
Saifeddine ALOUI 2023-04-08 08:27:58 +02:00 committed by GitHub
commit c30e46fbcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 4 deletions

2
app.py
View File

@ -468,7 +468,7 @@ if __name__ == "__main__":
)
parser.add_argument(
"-m", "--model", type=str, default="gpt4all-lora-quantized.bin", help="Force using a specific model."
"-m", "--model", type=str, default="gpt4all-lora-quantized-ggml.bin", help="Force using a specific model."
)
parser.add_argument(
"--temp", type=float, default=0.1, help="Temperature parameter for the model."

35
run.bat
View File

@ -35,6 +35,35 @@ echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
echo HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
echo on
call env/Scripts/activate.bat
python app.py %*
REM Activate the virtual environment
call env\Scripts\activate.bat
:RESTART
REM Run the Python app
python app.py %*
set app_result=%errorlevel%
REM Ask if user wants the model fixed
IF %app_result% EQU 0 (
goto END
) ELSE (
echo.
choice /C YN /M "The model file (gpt4all-lora-quantized-ggml.bin) appears to be invalid. Do you want to fix it?"
if errorlevel 2 goto END
if errorlevel 1 goto MODEL_FIX
)
REM Git Clone, Renames the bad model and fixes it using the same original name
:MODEL_FIX
if not exist llama.cpp git clone https://github.com/ggerganov/llama.cpp.git
move models\gpt4all-lora-quantized-ggml.bin models\gpt4all-lora-quantized-ggml.bin.original
python llama.cpp\migrate-ggml-2023-03-30-pr613.py models\gpt4all-lora-quantized-ggml.bin.original models\gpt4all-lora-quantized-ggml.bin
echo The model file (gpt4all-lora-quantized-ggml.bin) has been fixed. Press any key to restart...
pause >nul
goto RESTART
:END
REM Wait for user input before exiting
echo.
echo Press any key to exit...
pause >nul