Read more metadata (config.json & quantize_config.json)

This commit is contained in:
oobabooga 2023-09-29 06:14:16 -07:00
parent 56b5a4af74
commit 96da2e1c0d
3 changed files with 59 additions and 67 deletions

View file

@ -258,9 +258,10 @@ def download_model_wrapper(repo_id, specific_file, progress=gr.Progress(), retur
def update_truncation_length(current_length, state):
if state['loader'].lower().startswith('exllama'):
return state['max_seq_len']
elif state['loader'] in ['llama.cpp', 'llamacpp_HF', 'ctransformers']:
return state['n_ctx']
else:
return current_length
if 'loader' in state:
if state['loader'].lower().startswith('exllama'):
return state['max_seq_len']
elif state['loader'] in ['llama.cpp', 'llamacpp_HF', 'ctransformers']:
return state['n_ctx']
return current_length