mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-05 06:35:15 +00:00
Optimize the UI (#6251)
This commit is contained in:
parent
a14c510afb
commit
79c4d3da3d
11 changed files with 394 additions and 210 deletions
|
|
@ -95,11 +95,10 @@ def get_available_presets():
|
|||
|
||||
|
||||
def get_available_prompts():
|
||||
prompts = []
|
||||
files = set((k.stem for k in Path('prompts').glob('*.txt')))
|
||||
prompts += sorted([k for k in files if re.match('^[0-9]', k)], key=natural_keys, reverse=True)
|
||||
prompts += sorted([k for k in files if re.match('^[^0-9]', k)], key=natural_keys)
|
||||
prompts += ['None']
|
||||
prompt_files = list(Path('prompts').glob('*.txt'))
|
||||
sorted_files = sorted(prompt_files, key=lambda x: x.stat().st_mtime, reverse=True)
|
||||
prompts = [file.stem for file in sorted_files]
|
||||
prompts.append('None')
|
||||
return prompts
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue