This commit is contained in:
Saifeddine ALOUI 2023-04-14 22:16:25 +02:00
parent ce59ffef15
commit 8fc7011897
2 changed files with 21 additions and 6 deletions

15
app.py
View File

@ -167,12 +167,15 @@ class Gpt4AllWebUI:
def create_chatbot(self):
return Model(
ggml_model=f"./models/{self.config['model']}",
n_ctx=self.config['ctx_size'],
seed=self.config['seed'],
)
try:
return Model(
ggml_model=f"./models/{self.config['model']}",
n_ctx=self.config['ctx_size'],
seed=self.config['seed'],
)
except Exception as ex:
print(f"Exception {ex}")
return None
def condition_chatbot(self, conditionning_message):
if self.current_discussion is None:
self.current_discussion = self.db.load_last_discussion()

12
scripts/convert model.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
@echo off
set filename=../models/ggml-alpaca-7b-q4.bin
set newname=../models/ggml-alpaca-7b-q4.bin.original
echo %modelPath%
echo Converting the model to the new format...
if not exist tmp\llama.cpp git clone https://github.com/ggerganov/llama.cpp.git tmp\llama.cpp
cd tmp\llama.cpp
git checkout 0f07cacb05f49704d35a39aa27cfd4b419eb6f8d
move /y "%filename%" "%filename%.original"
python tmp\llama.cpp\migrate-ggml-2023-03-30-pr613.py "%filename%.original" "%filename%"