mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 09:19:23 +01:00
Fix dynatemp parameters always visible
This commit is contained in:
parent
29c2693ea0
commit
372ef5e2d8
@ -356,12 +356,20 @@ def list_all_samplers():
|
||||
return sorted(all_samplers)
|
||||
|
||||
|
||||
def blacklist_samplers(loader):
|
||||
def blacklist_samplers(loader, dynamic_temperature):
|
||||
all_samplers = list_all_samplers()
|
||||
if loader == 'All':
|
||||
return [gr.update(visible=True) for sampler in all_samplers]
|
||||
output = []
|
||||
|
||||
for sampler in all_samplers:
|
||||
if loader == 'All' or sampler in loaders_samplers[loader]:
|
||||
if sampler.startswith('dynatemp'):
|
||||
output.append(gr.update(visible=dynamic_temperature))
|
||||
else:
|
||||
return [gr.update(visible=True) if sampler in loaders_samplers[loader] else gr.update(visible=False) for sampler in all_samplers]
|
||||
output.append(gr.update(visible=True))
|
||||
else:
|
||||
output.append(gr.update(visible=False))
|
||||
|
||||
return output
|
||||
|
||||
|
||||
def get_model_types(loader):
|
||||
|
@ -95,7 +95,7 @@ def create_ui(default_preset):
|
||||
|
||||
|
||||
def create_event_handlers():
|
||||
shared.gradio['filter_by_loader'].change(loaders.blacklist_samplers, gradio('filter_by_loader'), gradio(loaders.list_all_samplers()), show_progress=False)
|
||||
shared.gradio['filter_by_loader'].change(loaders.blacklist_samplers, gradio('filter_by_loader', 'dynamic_temperature'), gradio(loaders.list_all_samplers()), show_progress=False)
|
||||
shared.gradio['preset_menu'].change(presets.load_preset_for_ui, gradio('preset_menu', 'interface_state'), gradio('interface_state') + gradio(presets.presets_params()))
|
||||
shared.gradio['random_preset'].click(presets.random_preset, gradio('interface_state'), gradio('interface_state') + gradio(presets.presets_params()))
|
||||
shared.gradio['grammar_file'].change(load_grammar, gradio('grammar_file'), gradio('grammar_string'))
|
||||
|
Loading…
Reference in New Issue
Block a user