mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-05 14:45:28 +00:00
Autosave generated text in the Notebook tab (#7079)
This commit is contained in:
parent
d0befe0729
commit
faae4dc1b0
9 changed files with 325 additions and 52 deletions
|
|
@ -159,10 +159,12 @@ def get_available_presets():
|
|||
|
||||
|
||||
def get_available_prompts():
|
||||
prompt_files = list(Path('user_data/prompts').glob('*.txt'))
|
||||
notebook_dir = Path('user_data/logs/notebook')
|
||||
notebook_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
prompt_files = list(notebook_dir.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