Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ import os
|
|
7 |
import streamlit as st
|
8 |
from audio_recorder_streamlit import audio_recorder
|
9 |
from langdetect import detect
|
|
|
10 |
# Use a pipeline as a high-level helper
|
11 |
#from transformers import pipeline
|
12 |
#pipe = pipeline("automatic-speech-recognition", model="openai/whisper-large")
|
@@ -54,8 +55,8 @@ if audio_bytes:
|
|
54 |
else:
|
55 |
st.write("No audio recorded.")
|
56 |
# Detect the language
|
57 |
-
language = detect(
|
58 |
st.write(f"Detected language: {language}")
|
59 |
|
60 |
# Create and open a txt file with the text
|
61 |
-
create_and_open_txt(
|
|
|
7 |
import streamlit as st
|
8 |
from audio_recorder_streamlit import audio_recorder
|
9 |
from langdetect import detect
|
10 |
+
import numpy as np
|
11 |
# Use a pipeline as a high-level helper
|
12 |
#from transformers import pipeline
|
13 |
#pipe = pipeline("automatic-speech-recognition", model="openai/whisper-large")
|
|
|
55 |
else:
|
56 |
st.write("No audio recorded.")
|
57 |
# Detect the language
|
58 |
+
language = detect(transcription)
|
59 |
st.write(f"Detected language: {language}")
|
60 |
|
61 |
# Create and open a txt file with the text
|
62 |
+
create_and_open_txt(transcription, f"output_{language}.txt")
|