Labbeti commited on
Commit
2ec8ef6
1 Parent(s): 5f47c66

Add/Fix: Add spinner during generation and fix results order.

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -107,6 +107,9 @@ def get_results(
107
 
108
 
109
  def show_results(outputs: dict[str, Union[dict[str, Any], str]]) -> None:
 
 
 
110
  st.divider()
111
 
112
  for audio_fname, output in outputs.items():
@@ -217,7 +220,9 @@ def main() -> None:
217
  audios |= {RECORD_AUDIO_FNAME: record_data}
218
 
219
  if len(audios) > 0:
220
- outputs = get_results(model, audios, generate_kwds)
 
 
221
  show_results(outputs)
222
 
223
 
 
107
 
108
 
109
  def show_results(outputs: dict[str, Union[dict[str, Any], str]]) -> None:
110
+ keys = list(outputs.keys())[::-1]
111
+ outputs = {key: outputs[key] for key in keys}
112
+
113
  st.divider()
114
 
115
  for audio_fname, output in outputs.items():
 
220
  audios |= {RECORD_AUDIO_FNAME: record_data}
221
 
222
  if len(audios) > 0:
223
+ with st.spinner("Generating descriptions..."):
224
+ outputs = get_results(model, audios, generate_kwds)
225
+ st.header("Results:")
226
  show_results(outputs)
227
 
228