qqubb commited on
Commit
8d296cc
·
1 Parent(s): 753d9d7

add text entry box to change card_label

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -90,6 +90,8 @@ with project_col:
90
  project_cc = cards["project_file"]
91
  with st.expander("project details"):
92
  for section, items in project_cc.items():
 
 
93
  if section != 'card_details':
94
  st.header(section.replace('_', ' ').title()) # section header
95
  for key, details in items.items():
@@ -124,12 +126,12 @@ with data_col:
124
 
125
  st.title("Data Card")
126
  if cards['data_files']:
127
- # selected_data_file = st.selectbox("Select a Data CC", cards['data_files'], format_func=format_card_label)
128
- # data_cc = selected_data_file[1]
129
  for card in cards['data_files']:
130
  data_cc = card[1]
131
  with st.expander(f"{card[0]}"):
132
  for section, items in data_cc.items():
 
 
133
  if section != 'card_details':
134
  st.header(section.replace('_', ' ').title()) # section header
135
  for key, details in items.items():
@@ -164,12 +166,12 @@ with model_col:
164
 
165
  st.title("Model Card")
166
  if cards['model_files']:
167
- # selected_data_file = st.selectbox("Select a Modle CC", cards['model_files'], format_func=format_card_label)
168
- # model_cc = selected_data_file[1]
169
  for card in cards['model_files']:
170
  model_cc = card[1]
171
  with st.expander(f"{card[0]}"):
172
  for section, items in model_cc.items():
 
 
173
  if section != 'card_details':
174
  st.header(section.replace('_', ' ').title()) # section header
175
  for key, details in items.items():
 
90
  project_cc = cards["project_file"]
91
  with st.expander("project details"):
92
  for section, items in project_cc.items():
93
+ if section == 'card_details':
94
+ items['card_label'] = st.text_input("card_label", value=items['card_label'])
95
  if section != 'card_details':
96
  st.header(section.replace('_', ' ').title()) # section header
97
  for key, details in items.items():
 
126
 
127
  st.title("Data Card")
128
  if cards['data_files']:
 
 
129
  for card in cards['data_files']:
130
  data_cc = card[1]
131
  with st.expander(f"{card[0]}"):
132
  for section, items in data_cc.items():
133
+ if section == 'card_details':
134
+ items['card_label'] = st.text_input('card_label', value=items['card_label'], key=f"data_{card[0]}_{key}")
135
  if section != 'card_details':
136
  st.header(section.replace('_', ' ').title()) # section header
137
  for key, details in items.items():
 
166
 
167
  st.title("Model Card")
168
  if cards['model_files']:
 
 
169
  for card in cards['model_files']:
170
  model_cc = card[1]
171
  with st.expander(f"{card[0]}"):
172
  for section, items in model_cc.items():
173
+ if section == 'card_details':
174
+ items['card_label'] = st.text_input('card_label', value=items['card_label'], key=f"data_{card[0]}_{key}")
175
  if section != 'card_details':
176
  st.header(section.replace('_', ' ').title()) # section header
177
  for key, details in items.items():