Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,15 @@ sentiment_threshold = 0.75
|
|
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)
|
|
|
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)
|