UI: Correctly propagate truncation_length when ctx_size is auto

This commit is contained in:
oobabooga 2026-03-12 14:54:05 -07:00
parent 3e6bd1a310
commit bbd43d9463
3 changed files with 14 additions and 2 deletions

View file

@ -54,6 +54,8 @@ def load_model(model_name, loader=None):
if loader.lower().startswith('exllama') or loader.lower().startswith('tensorrt') or loader == 'llama.cpp':
if shared.args.ctx_size > 0:
shared.settings['truncation_length'] = shared.args.ctx_size
elif loader == 'llama.cpp' and hasattr(model, 'n_ctx') and model.n_ctx:
shared.settings['truncation_length'] = model.n_ctx
shared.is_multimodal = False
if loader.lower() in ('exllamav3', 'llama.cpp') and hasattr(model, 'is_multimodal'):