Add a /v1/internal/chat-prompt endpoint (#5879)

This commit is contained in:
oobabooga 2024-04-19 00:24:46 -03:00 committed by GitHub
parent b30bce3b2f
commit f27e1ba302
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 35 additions and 11 deletions

View file

@ -136,9 +136,6 @@ def get_model_metadata(model):
if 'instruction_template' not in model_settings:
model_settings['instruction_template'] = 'Alpaca'
if model_settings['instruction_template'] != 'Custom (obtained from model metadata)':
model_settings['instruction_template_str'] = chat.load_instruction_template(model_settings['instruction_template'])
# Ignore rope_freq_base if set to the default value
if 'rope_freq_base' in model_settings and model_settings['rope_freq_base'] == 10000:
model_settings.pop('rope_freq_base')
@ -150,6 +147,10 @@ def get_model_metadata(model):
for k in settings[pat]:
model_settings[k] = settings[pat][k]
# Load instruction template if defined by name rather than by value
if model_settings['instruction_template'] != 'Custom (obtained from model metadata)':
model_settings['instruction_template_str'] = chat.load_instruction_template(model_settings['instruction_template'])
return model_settings