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

@ -388,7 +388,11 @@ def download_model_wrapper(repo_id, specific_file, progress=gr.Progress(), retur
def update_truncation_length(current_length, state):
if 'loader' in state:
if state['loader'].lower().startswith('exllama') or state['loader'] == 'llama.cpp':
return state['ctx_size']
if state['ctx_size'] > 0:
return state['ctx_size']
# ctx_size == 0 means auto: use the actual value from the server
return shared.settings['truncation_length']
return current_length