Minor changes

This commit is contained in:
oobabooga 2023-03-31 14:33:46 -03:00
parent 9d1dcf880a
commit 4c27562157
2 changed files with 4 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,4 +1,3 @@
.vscode
cache cache
characters characters
training/datasets training/datasets
@ -15,6 +14,7 @@ torch-dumps
*/*/pycache* */*/pycache*
venv/ venv/
.venv/ .venv/
.vscode
repositories repositories
settings.json settings.json

View File

@ -42,8 +42,7 @@ def load_model(model_name):
t0 = time.time() t0 = time.time()
shared.is_RWKV = 'rwkv-' in model_name.lower() shared.is_RWKV = 'rwkv-' in model_name.lower()
shared.is_llamacpp = model_name.lower().startswith('llamacpp-') or \ shared.is_llamacpp = model_name.lower().startswith(('llamacpp', 'alpaca-cpp'))
model_name.lower().startswith('alpaca-cpp-')
# Default settings # Default settings
if not any([shared.args.cpu, shared.args.load_in_8bit, shared.args.wbits, shared.args.auto_devices, shared.args.disk, shared.args.gpu_memory is not None, shared.args.cpu_memory is not None, shared.args.deepspeed, shared.args.flexgen, shared.is_RWKV, shared.is_llamacpp]): if not any([shared.args.cpu, shared.args.load_in_8bit, shared.args.wbits, shared.args.auto_devices, shared.args.disk, shared.args.gpu_memory is not None, shared.args.cpu_memory is not None, shared.args.deepspeed, shared.args.flexgen, shared.is_RWKV, shared.is_llamacpp]):
@ -102,11 +101,11 @@ def load_model(model_name):
model = load_quantized(model_name) model = load_quantized(model_name)
# LLAMACPP model # llamacpp model
elif shared.is_llamacpp: elif shared.is_llamacpp:
from modules.llamacpp_model import LlamaCppModel from modules.llamacpp_model import LlamaCppModel
if model_name.lower().startswith('alpaca-'): if model_name.lower().startswith('alpaca-cpp'):
model_file = f'models/{model_name}/ggml-alpaca-7b-q4.bin' model_file = f'models/{model_name}/ggml-alpaca-7b-q4.bin'
else: else:
model_file = f'models/{model_name}/ggml-model-q4_0.bin' model_file = f'models/{model_name}/ggml-model-q4_0.bin'