mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-07 23:53:40 +00:00
Fix the UI failing to launch if the Notebook prompt is too long
This commit is contained in:
parent
08f90f4b64
commit
a3eb67e466
4 changed files with 11 additions and 6 deletions
|
|
@ -6,6 +6,7 @@ from pathlib import Path
|
|||
from modules import shared
|
||||
from modules.block_requests import OpenMonkeyPatch, RequestBlocker
|
||||
from modules.logging_colors import logger
|
||||
from modules.prompts import load_prompt
|
||||
|
||||
# Set up Gradio temp directory path
|
||||
gradio_temp_path = Path('user_data') / 'cache' / 'gradio'
|
||||
|
|
@ -109,6 +110,13 @@ def create_interface():
|
|||
'filter_by_loader': (shared.args.loader or 'All') if not shared.args.portable else 'llama.cpp'
|
||||
})
|
||||
|
||||
if shared.settings['prompt-notebook']:
|
||||
prompt = load_prompt(shared.settings['prompt-notebook'])
|
||||
shared.persistent_interface_state.update({
|
||||
'textbox-default': prompt,
|
||||
'textbox-notebook': prompt
|
||||
})
|
||||
|
||||
# Clear existing cache files
|
||||
for cache_file in ['pfp_character.png', 'pfp_character_thumb.png']:
|
||||
cache_path = Path(f"user_data/cache/{cache_file}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue