mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-05 22:55:22 +00:00
Safer usage of mkdir across the project
This commit is contained in:
parent
8689d7ecea
commit
0d1597616f
16 changed files with 240 additions and 206 deletions
|
|
@ -160,7 +160,8 @@ def get_available_presets():
|
|||
|
||||
def get_available_prompts():
|
||||
notebook_dir = Path('user_data/logs/notebook')
|
||||
notebook_dir.mkdir(parents=True, exist_ok=True)
|
||||
if not notebook_dir.exists():
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue