Spaces:
Sleeping
Sleeping
Commit
·
f76ff96
1
Parent(s):
c8b7fcf
globalize formatted history in local function transcribe
Browse files
app.py
CHANGED
@@ -54,6 +54,8 @@ def generate(user_prompt, temperature=0.1, max_new_tokens=128, top_p=0.95, repet
|
|
54 |
|
55 |
@spaces.GPU(duration=60)
|
56 |
def transcribe(audio):
|
|
|
|
|
57 |
sr, y = audio
|
58 |
y = y.astype(np.float32)
|
59 |
y /= np.max(np.abs(y))
|
@@ -90,7 +92,7 @@ with gr.Blocks() as demo:
|
|
90 |
|
91 |
transcription_box = gr.Textbox(
|
92 |
formatted_history, label="Transcription")
|
93 |
-
|
94 |
transcribe_btn.click(fn=transcribe, inputs=audio_input,
|
95 |
outputs=[output_audio, transcription_box])
|
96 |
|
|
|
54 |
|
55 |
@spaces.GPU(duration=60)
|
56 |
def transcribe(audio):
|
57 |
+
global formatted_history
|
58 |
+
|
59 |
sr, y = audio
|
60 |
y = y.astype(np.float32)
|
61 |
y /= np.max(np.abs(y))
|
|
|
92 |
|
93 |
transcription_box = gr.Textbox(
|
94 |
formatted_history, label="Transcription")
|
95 |
+
|
96 |
transcribe_btn.click(fn=transcribe, inputs=audio_input,
|
97 |
outputs=[output_audio, transcription_box])
|
98 |
|