Luigi commited on
Commit
fc7c6c6
·
1 Parent(s): e9b378f

fix: refresh Model Information panel after custom GGUF model loads

Browse files

Chain .then() after load_btn and retry_btn click handlers to re-trigger
update_settings_on_model_change with updated custom_model_metadata,
so info_output displays actual repo ID, filename, and size.

Also remove duplicate submit_btn.click() registration that was missing
custom_model_state input and could cause argument mismatch.

Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -1770,12 +1770,8 @@ def create_interface():
1770
  return temperature, top_p_val, top_k_val, info_text
1771
 
1772
  # Event handlers
1773
- submit_btn.click(
1774
- fn=summarize_streaming,
1775
- inputs=[file_input, model_dropdown, enable_reasoning, max_tokens, temperature_slider, top_p, top_k, language_selector, thread_config_dropdown, custom_threads_slider],
1776
- outputs=[thinking_output, summary_output, info_output, metrics_state],
1777
- show_progress="full"
1778
- )
1779
 
1780
  # Update settings when model changes
1781
  model_dropdown.change(
@@ -2017,6 +2013,10 @@ def create_interface():
2017
  fn=load_custom_model_selected,
2018
  inputs=[model_search_input, custom_file_dropdown, custom_repo_files],
2019
  outputs=[custom_status, retry_btn, custom_model_state, custom_model_metadata],
 
 
 
 
2020
  )
2021
 
2022
  # Retry button - same as load
@@ -2024,6 +2024,10 @@ def create_interface():
2024
  fn=load_custom_model_selected,
2025
  inputs=[model_search_input, custom_file_dropdown, custom_repo_files],
2026
  outputs=[custom_status, retry_btn, custom_model_state, custom_model_metadata],
 
 
 
 
2027
  )
2028
 
2029
  # Also update submit button to use custom model state
 
1770
  return temperature, top_p_val, top_k_val, info_text
1771
 
1772
  # Event handlers
1773
+ # Note: submit_btn.click is registered below (after custom model loader section)
1774
+ # with the full set of inputs including custom_model_state
 
 
 
 
1775
 
1776
  # Update settings when model changes
1777
  model_dropdown.change(
 
2013
  fn=load_custom_model_selected,
2014
  inputs=[model_search_input, custom_file_dropdown, custom_repo_files],
2015
  outputs=[custom_status, retry_btn, custom_model_state, custom_model_metadata],
2016
+ ).then(
2017
+ fn=update_settings_on_model_change,
2018
+ inputs=[model_dropdown, thread_config_dropdown, custom_threads_slider, custom_model_metadata],
2019
+ outputs=[temperature_slider, top_p, top_k, info_output],
2020
  )
2021
 
2022
  # Retry button - same as load
 
2024
  fn=load_custom_model_selected,
2025
  inputs=[model_search_input, custom_file_dropdown, custom_repo_files],
2026
  outputs=[custom_status, retry_btn, custom_model_state, custom_model_metadata],
2027
+ ).then(
2028
+ fn=update_settings_on_model_change,
2029
+ inputs=[model_dropdown, thread_config_dropdown, custom_threads_slider, custom_model_metadata],
2030
+ outputs=[temperature_slider, top_p, top_k, info_output],
2031
  )
2032
 
2033
  # Also update submit button to use custom model state