Add a "llamacpp_HF creator" menu (#5519)

This commit is contained in:
oobabooga 2024-02-16 12:43:24 -03:00 committed by GitHub
parent b2b74c83a6
commit 44018c2f69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 69 additions and 16 deletions

View file

@ -76,7 +76,16 @@ def get_available_models():
model_list = []
for item in list(Path(f'{shared.args.model_dir}/').glob('*')):
if not item.name.endswith(('.txt', '-np', '.pt', '.json', '.yaml', '.py')) and 'llama-tokenizer' not in item.name:
model_list.append(re.sub('.pth$', '', item.name))
model_list.append(item.name)
return ['None'] + sorted(model_list, key=natural_keys)
def get_available_ggufs():
model_list = []
for item in Path(f'{shared.args.model_dir}/').glob('*'):
if item.is_file() and item.name.lower().endswith(".gguf"):
model_list.append(item.name)
return ['None'] + sorted(model_list, key=natural_keys)