HawkClaws commited on
Commit
5654dac
·
verified ·
1 Parent(s): 8ca2883

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -86,15 +86,10 @@ st.title("Model Structure Comparison Tool")
86
  model_id1 = st.text_input("Enter the first HuggingFace Model ID")
87
  model_id2 = st.text_input("Enter the second HuggingFace Model ID")
88
 
89
- compare_button_clicked = st.button("Compare Models", key="compare_button")
 
90
 
91
- if compare_button_clicked:
92
- st.session_state["compare_button_disabled"] = True
93
-
94
- if "compare_button_disabled" not in st.session_state:
95
- st.session_state["compare_button_disabled"] = False
96
-
97
- if st.session_state["compare_button_disabled"]:
98
  with st.spinner('Comparing models and loading tokenizers...'):
99
  if model_id1 and model_id2:
100
  struct1 = get_model_structure(model_id1)
@@ -127,6 +122,7 @@ if st.session_state["compare_button_disabled"]:
127
  st.error(f"Error loading tokenizers: {e}")
128
  else:
129
  st.error("Please enter both model IDs.")
130
- st.session_state["compare_button_disabled"] = False
131
  else:
132
- st.button("Compare Models", key="compare_button_disabled", disabled=True)
 
 
86
  model_id1 = st.text_input("Enter the first HuggingFace Model ID")
87
  model_id2 = st.text_input("Enter the second HuggingFace Model ID")
88
 
89
+ if "compare_button_clicked" not in st.session_state:
90
+ st.session_state.compare_button_clicked = False
91
 
92
+ if st.session_state.compare_button_clicked:
 
 
 
 
 
 
93
  with st.spinner('Comparing models and loading tokenizers...'):
94
  if model_id1 and model_id2:
95
  struct1 = get_model_structure(model_id1)
 
122
  st.error(f"Error loading tokenizers: {e}")
123
  else:
124
  st.error("Please enter both model IDs.")
125
+ st.session_state.compare_button_clicked = False
126
  else:
127
+ if st.button("Compare Models"):
128
+ st.session_state.compare_button_clicked = True