5w4n commited on
Commit
a57f878
1 Parent(s): f25131d

Update chart

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -94,6 +94,18 @@ st.table(st.session_state.examplesdf)
94
  import plotly.figure_factory as ff
95
 
96
  if selected_tokenizers:
 
 
 
 
 
 
 
 
 
 
 
 
97
  # Collecting data for all selected tokenizers
98
  hist_data = [val_data[tokenizer].dropna() for tokenizer in selected_tokenizers]
99
 
@@ -109,17 +121,6 @@ if selected_tokenizers:
109
  )
110
  st.plotly_chart(fig, use_container_width=True)
111
 
112
- tokenizer_to_num_tokens = {
113
- name: val_data[name].tolist() for name in selected_tokenizers
114
- }
115
-
116
- fig = go.Figure()
117
- for tokenizer_name in selected_tokenizers:
118
- fig.add_trace(
119
- go.Box(y=tokenizer_to_num_tokens[tokenizer_name], name=tokenizer_name)
120
- )
121
- fig.update_layout(title="Token Count Variability")
122
- st.plotly_chart(fig)
123
  else:
124
  st.error(
125
  "No tokenizers selected. Please select at least one tokenizer to view the distribution plot."
 
94
  import plotly.figure_factory as ff
95
 
96
  if selected_tokenizers:
97
+ tokenizer_to_num_tokens = {
98
+ name: val_data[name].tolist() for name in selected_tokenizers
99
+ }
100
+
101
+ fig = go.Figure()
102
+ for tokenizer_name in selected_tokenizers:
103
+ fig.add_trace(
104
+ go.Box(y=tokenizer_to_num_tokens[tokenizer_name], name=tokenizer_name)
105
+ )
106
+ fig.update_layout(title="Token Count Variability")
107
+ st.plotly_chart(fig)
108
+
109
  # Collecting data for all selected tokenizers
110
  hist_data = [val_data[tokenizer].dropna() for tokenizer in selected_tokenizers]
111
 
 
121
  )
122
  st.plotly_chart(fig, use_container_width=True)
123
 
 
 
 
 
 
 
 
 
 
 
 
124
  else:
125
  st.error(
126
  "No tokenizers selected. Please select at least one tokenizer to view the distribution plot."