abidlabs HF Staff commited on
Commit
caec3f2
·
1 Parent(s): f90a6e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -17,15 +17,6 @@ sentiment_threshold = 0.75
17
 
18
  EXAMPLES = ["example_audio.wav"]
19
 
20
- def cache_example(example):
21
- processed_examples = audio.preprocess_example(example)
22
- return processed_examples
23
-
24
- cache = [cache_example(e) for e in EXAMPLES]
25
-
26
- def load_example(example_id):
27
- return cache[example_id]
28
-
29
  def speech_to_text(speech):
30
  speaker_output = speaker_segmentation(speech)
31
  speech, sampling_rate = load(speech)
@@ -89,10 +80,15 @@ with demo:
89
  btn.click(speech_to_text, audio, [diarized, full], status_tracker=gr.StatusTracker(cover_container=True))
90
  check.change(sentiment, [check, diarized], analyzed, status_tracker=gr.StatusTracker(cover_container=True))
91
 
92
- def load_example(example_id):
93
- processed_examples = audio.preprocess_example(EXAMPLES[example_id])
94
  return processed_examples
95
-
 
 
 
 
 
96
  examples._click_no_postprocess(load_example, inputs=[examples], outputs=[audio])
97
 
98
  demo.launch()
 
17
 
18
  EXAMPLES = ["example_audio.wav"]
19
 
 
 
 
 
 
 
 
 
 
20
  def speech_to_text(speech):
21
  speaker_output = speaker_segmentation(speech)
22
  speech, sampling_rate = load(speech)
 
80
  btn.click(speech_to_text, audio, [diarized, full], status_tracker=gr.StatusTracker(cover_container=True))
81
  check.change(sentiment, [check, diarized], analyzed, status_tracker=gr.StatusTracker(cover_container=True))
82
 
83
+ def cache_example(example):
84
+ processed_examples = audio.preprocess_example(example)
85
  return processed_examples
86
+
87
+ cache = [cache_example(e) for e in EXAMPLES]
88
+
89
+ def load_example(example_id):
90
+ return cache[example_id]
91
+
92
  examples._click_no_postprocess(load_example, inputs=[examples], outputs=[audio])
93
 
94
  demo.launch()