mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
exclude .modelfile extension
This commit is contained in:
parent
b6c4e35fd8
commit
317e6f9b6c
@ -73,12 +73,13 @@ def natural_keys(text):
|
|||||||
|
|
||||||
|
|
||||||
def get_available_models():
|
def get_available_models():
|
||||||
|
exclude_extensions = ('.txt', '-np', '.pt', '.json', '.yaml', '.py', '.modelfile')
|
||||||
model_list = []
|
model_list = []
|
||||||
for dirpath, dirnames, files in os.walk(shared.args.model_dir, followlinks=True):
|
for dirpath, dirnames, files in os.walk(shared.args.model_dir, followlinks=True):
|
||||||
for file in files:
|
for file in files:
|
||||||
file_path = os.path.join(dirpath, file)
|
file_path = os.path.join(dirpath, file)
|
||||||
relative_path = os.path.relpath(file_path, shared.args.model_dir)
|
relative_path = os.path.relpath(file_path, shared.args.model_dir)
|
||||||
if not file.endswith(('.txt', '-np', '.pt', '.json', '.yaml', '.py')) and 'llama-tokenizer' not in relative_path:
|
if not file.endswith(exclude_extensions) and 'llama-tokenizer' not in relative_path:
|
||||||
model_list.append(relative_path)
|
model_list.append(relative_path)
|
||||||
return ['None'] + sorted(model_list, key=natural_keys)
|
return ['None'] + sorted(model_list, key=natural_keys)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user