zhuohan-7 commited on
Commit
11356c3
1 Parent(s): a192c8e

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app/draw_diagram.py +10 -9
  2. app/show_examples.py +10 -8
app/draw_diagram.py CHANGED
@@ -97,16 +97,17 @@ def draw(folder_name, category_name, dataset_name, metrics):
97
  Show table
98
  '''
99
  # st.divider()
100
- with st.expander('TABLE'):
 
101
  # chart_data['Link'] = chart_data['Model'].map(links_dic)
102
- st.dataframe(chart_data,
103
- # column_config = {
104
- # "Link": st.column_config.LinkColumn(
105
- # display_text= st.image(huggingface_image)
106
- # ),
107
- # },
108
- hide_index = True,
109
- use_container_width=True)
110
  '''
111
  show samples
112
  '''
 
97
  Show table
98
  '''
99
  # st.divider()
100
+ st.write("")
101
+ st.markdown('##### TABLE')
102
  # chart_data['Link'] = chart_data['Model'].map(links_dic)
103
+ st.dataframe(chart_data,
104
+ # column_config = {
105
+ # "Link": st.column_config.LinkColumn(
106
+ # display_text= st.image(huggingface_image)
107
+ # ),
108
+ # },
109
+ hide_index = True,
110
+ use_container_width=True)
111
  '''
112
  show samples
113
  '''
app/show_examples.py CHANGED
@@ -8,13 +8,13 @@ def show_examples(category_name, dataset_name, model_lists):
8
  dataset = datasets.load_from_disk(sample_folder)
9
 
10
  for index in range(len(dataset)):
11
-
12
- with st.expander(f'EXAMPLE {index+1}'):
13
  col1, col2 = st.columns([0.3, 0.7], vertical_alignment="center")
14
 
15
  with col1:
16
  st.audio(f'{sample_folder}/sample_{index}.wav', format="audio/wav")
17
-
18
  with col2:
19
  with st.container():
20
  custom_css = """
@@ -38,10 +38,10 @@ def show_examples(category_name, dataset_name, model_lists):
38
  choices_text = ' '.join(i for i in choices)
39
 
40
  question_text = f"""<div class="my-container-question">
41
- <p>QUESTION: {dataset[index]['instruction']['text']}</p>
42
- <p>CHOICES: {choices_text}</p>
43
- </div>
44
- """
45
  else:
46
  question_text = f"""<div class="my-container-question">
47
  <p>QUESTION: {dataset[index]['instruction']['text']}</p>
@@ -67,7 +67,7 @@ def show_examples(category_name, dataset_name, model_lists):
67
  </div>""", unsafe_allow_html=True)
68
 
69
 
70
- st.divider()
71
  with st.container():
72
  custom_css = """
73
  <style>
@@ -123,6 +123,8 @@ def show_examples(category_name, dataset_name, model_lists):
123
  </div>""", unsafe_allow_html=True)
124
 
125
  st.text("")
 
 
126
 
127
 
128
 
 
8
  dataset = datasets.load_from_disk(sample_folder)
9
 
10
  for index in range(len(dataset)):
11
+ with st.container():
12
+ st.markdown(f'##### EXAMPLE {index+1}')
13
  col1, col2 = st.columns([0.3, 0.7], vertical_alignment="center")
14
 
15
  with col1:
16
  st.audio(f'{sample_folder}/sample_{index}.wav', format="audio/wav")
17
+
18
  with col2:
19
  with st.container():
20
  custom_css = """
 
38
  choices_text = ' '.join(i for i in choices)
39
 
40
  question_text = f"""<div class="my-container-question">
41
+ <p>QUESTION: {dataset[index]['instruction']['text']}</p>
42
+ <p>CHOICES: {choices_text}</p>
43
+ </div>
44
+ """
45
  else:
46
  question_text = f"""<div class="my-container-question">
47
  <p>QUESTION: {dataset[index]['instruction']['text']}</p>
 
67
  </div>""", unsafe_allow_html=True)
68
 
69
 
70
+ # st.divider()
71
  with st.container():
72
  custom_css = """
73
  <style>
 
123
  </div>""", unsafe_allow_html=True)
124
 
125
  st.text("")
126
+
127
+ st.divider()
128
 
129
 
130