zhuohan-7 commited on
Commit
138ed5d
·
verified ·
1 Parent(s): 54129dd

Update app/show_examples.py

Browse files
Files changed (1) hide show
  1. app/show_examples.py +3 -3
app/show_examples.py CHANGED
@@ -24,7 +24,7 @@ def show_dataset_examples(display_name):
24
  with col1:
25
  # Convert the NumPy array to a WAV file in memory
26
  bytes_io = io.BytesIO()
27
- sf.write(bytes_io, dataset[index]['context']['audio']['array'], dataset[index]['context']['audio']['sampling_rate'], format='WAV')
28
  bytes_io.seek(0)
29
  # Play audio in Streamlit
30
  st.audio(bytes_io, format='audio/wav')
@@ -40,7 +40,7 @@ def show_dataset_examples(display_name):
40
 
41
  question_text = f"""{dataset[index]['instruction']['text']} {choices_text}"""
42
  else:
43
- question_text = f"""{dataset[index]['instruction']['text']}"""
44
 
45
  question_text = html.escape(question_text)
46
 
@@ -69,7 +69,7 @@ def show_dataset_examples(display_name):
69
  <tr>
70
  <td><b>{html.escape(question_text.replace('(A)', '<br>(A)').replace('(B)', '<br>(B)').replace('(C)', '<br>(C)'))}
71
  </td>
72
- <td><b>{html.escape(dataset[index]['answer']['text'])}
73
  </td>
74
  </tr>
75
  </thead>
 
24
  with col1:
25
  # Convert the NumPy array to a WAV file in memory
26
  bytes_io = io.BytesIO()
27
+ sf.write(bytes_io, dataset[index]['context']['array'], dataset[index]['context']['sampling_rate'], format='WAV')
28
  bytes_io.seek(0)
29
  # Play audio in Streamlit
30
  st.audio(bytes_io, format='audio/wav')
 
40
 
41
  question_text = f"""{dataset[index]['instruction']['text']} {choices_text}"""
42
  else:
43
+ question_text = f"""{dataset[index]['instruction']}"""
44
 
45
  question_text = html.escape(question_text)
46
 
 
69
  <tr>
70
  <td><b>{html.escape(question_text.replace('(A)', '<br>(A)').replace('(B)', '<br>(B)').replace('(C)', '<br>(C)'))}
71
  </td>
72
+ <td><b>{html.escape(dataset[index]['answer'])}
73
  </td>
74
  </tr>
75
  </thead>