Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ SIDEBAR_INFO = f"""
|
|
57 |
|
58 |
# ------------transcribe section------------
|
59 |
|
60 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
61 |
|
62 |
@spaces.GPU()
|
63 |
def convert_to_wav(filepath):
|
@@ -66,7 +66,7 @@ def convert_to_wav(filepath):
|
|
66 |
os.system(f'ffmpeg -i "{filepath}" -ar 16000 -ac 1 -c:a pcm_s16le "{audio_file}"')
|
67 |
return audio_file
|
68 |
|
69 |
-
pipe = pipeline("automatic-speech-recognition", model="NbAiLab/nb-whisper-large", chunk_length_s=30)
|
70 |
|
71 |
@spaces.GPU()
|
72 |
def transcribe_audio(audio_file, batch_size=16):
|
@@ -268,7 +268,7 @@ with iface:
|
|
268 |
|
269 |
""")
|
270 |
|
271 |
-
|
272 |
summarize_transcribed_button_text_rank.click(fn=lambda text: text_rank_summary(text), inputs=[text_output], outputs=[summary_output_text_rank])
|
273 |
summarize_uploaded_button_text_rank = gr.Button("Upload Text to Summarize, Click Here")
|
274 |
summarize_uploaded_button_text_rank.click(fn=text_rank_summary, inputs=[text_input_text_rank], outputs=[summary_output_text_rank])
|
|
|
57 |
|
58 |
# ------------transcribe section------------
|
59 |
|
60 |
+
#device = "cuda" if torch.cuda.is_available() else "cpu"
|
61 |
|
62 |
@spaces.GPU()
|
63 |
def convert_to_wav(filepath):
|
|
|
66 |
os.system(f'ffmpeg -i "{filepath}" -ar 16000 -ac 1 -c:a pcm_s16le "{audio_file}"')
|
67 |
return audio_file
|
68 |
|
69 |
+
pipe = pipeline("automatic-speech-recognition", model="NbAiLab/nb-whisper-large", chunk_length_s=30)
|
70 |
|
71 |
@spaces.GPU()
|
72 |
def transcribe_audio(audio_file, batch_size=16):
|
|
|
268 |
|
269 |
""")
|
270 |
|
271 |
+
@ summarize_transcribed_button_text_rank = gr.Button("Summary of Transcribed Text, Click Here")
|
272 |
summarize_transcribed_button_text_rank.click(fn=lambda text: text_rank_summary(text), inputs=[text_output], outputs=[summary_output_text_rank])
|
273 |
summarize_uploaded_button_text_rank = gr.Button("Upload Text to Summarize, Click Here")
|
274 |
summarize_uploaded_button_text_rank.click(fn=text_rank_summary, inputs=[text_input_text_rank], outputs=[summary_output_text_rank])
|