Autodetect llamacpp_HF loader when tokenizer exists

This commit is contained in:
oobabooga 2024-02-16 09:29:26 -08:00
parent 76d28eaa9e
commit 4039999be5
2 changed files with 4 additions and 2 deletions

View file

@ -257,7 +257,7 @@ def llamacpp_HF_loader(model_name):
path = Path(f'{shared.args.model_dir}/{model_name}')
# Check if a HF tokenizer is available for the model
if all((path / file).exists() for file in ['tokenizer.json', 'tokenizer_config.json']):
if all((path / file).exists() for file in ['tokenizer_config.json']):
logger.info(f'Using tokenizer from: \"{path}\"')
else:
logger.error("Could not load the model because a tokenizer in Transformers format was not found.")