Add a menu for customizing the instruction template for the model (#5521)

This commit is contained in:
oobabooga 2024-02-16 14:21:17 -03:00 committed by GitHub
parent 0e1d8d5601
commit 76d28eaa9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 81 additions and 24 deletions

View file

@ -109,7 +109,7 @@ def create_chat_settings_ui():
with gr.Row():
with gr.Column():
with gr.Row():
shared.gradio['instruction_template'] = gr.Dropdown(choices=utils.get_available_instruction_templates(), label='Saved instruction templates', info="After selecting the template, click on \"Load\" to load and apply it.", value='Select template to load...', elem_classes='slim-dropdown')
shared.gradio['instruction_template'] = gr.Dropdown(choices=utils.get_available_instruction_templates(), label='Saved instruction templates', info="After selecting the template, click on \"Load\" to load and apply it.", value='None', elem_classes='slim-dropdown')
ui.create_refresh_button(shared.gradio['instruction_template'], lambda: None, lambda: {'choices': utils.get_available_instruction_templates()}, 'refresh-button', interactive=not mu)
shared.gradio['load_template'] = gr.Button("Load", elem_classes='refresh-button')
shared.gradio['save_template'] = gr.Button('💾', elem_classes='refresh-button', interactive=not mu)