Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -77,18 +77,19 @@ with demo:
|
|
77 |
check = gr.Radio(["Speaker 0", "Speaker 1"], label='Choose speaker for sentiment analysis')
|
78 |
analyzed = gr.HighlightedText(label="Customer Sentiment")
|
79 |
|
80 |
-
btn.click(speech_to_text, audio, [diarized, full]
|
81 |
-
check.change(sentiment, [check, diarized], analyzed
|
82 |
|
83 |
def cache_example(example):
|
84 |
processed_examples = audio.preprocess_example(example)
|
85 |
-
|
|
|
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()
|
|
|
77 |
check = gr.Radio(["Speaker 0", "Speaker 1"], label='Choose speaker for sentiment analysis')
|
78 |
analyzed = gr.HighlightedText(label="Customer Sentiment")
|
79 |
|
80 |
+
btn.click(speech_to_text, audio, [diarized, full])
|
81 |
+
check.change(sentiment, [check, diarized], analyzed)
|
82 |
|
83 |
def cache_example(example):
|
84 |
processed_examples = audio.preprocess_example(example)
|
85 |
+
diarized_output, full_text = speech_to_text(processed_examples )
|
86 |
+
return processed_examples, diarized_output, full_text
|
87 |
|
88 |
cache = [cache_example(e) for e in EXAMPLES]
|
89 |
|
90 |
def load_example(example_id):
|
91 |
return cache[example_id]
|
92 |
|
93 |
+
examples._click_no_postprocess(load_example, inputs=[examples], outputs=[audio, diarized, full], queue=False)
|
94 |
|
95 |
demo.launch()
|