Spaces:
Runtime error
Runtime error
Alexander Seifert
commited on
Commit
·
e6989d8
1
Parent(s):
d0fed63
make password listable
Browse files
app.py
CHANGED
@@ -7,6 +7,9 @@ import streamlit as st
|
|
7 |
from loguru import logger
|
8 |
from pydub import AudioSegment
|
9 |
|
|
|
|
|
|
|
10 |
run_transcription = modal.lookup("ffpub-transcription", "run_transcription")
|
11 |
|
12 |
st.set_page_config(page_title="Speech to Text Transcription App")
|
@@ -18,7 +21,7 @@ def transcribe(url, audio_b64, cutoff):
|
|
18 |
|
19 |
|
20 |
def password_is_correct(password):
|
21 |
-
return password in
|
22 |
|
23 |
|
24 |
def input_is_ready(password, audio_file, url):
|
@@ -75,7 +78,7 @@ def run():
|
|
75 |
# with st.expander(("Audio" if audio_file else "Video") + " abspielen"):
|
76 |
if audio_file:
|
77 |
st.audio(audio_file)
|
78 |
-
cutoff = None if password
|
79 |
audio_file = AudioSegment.from_file(audio_file)[:cutoff]
|
80 |
audio_b64 = base64.b64encode(audio_file.export().read()).decode("ascii")
|
81 |
if url:
|
|
|
7 |
from loguru import logger
|
8 |
from pydub import AudioSegment
|
9 |
|
10 |
+
PASSWORDS = os.environ["PASSWORD"].split(",")
|
11 |
+
ROOT_PASSWORDS = os.environ["ROOT_PASSWORD"].split(",")
|
12 |
+
|
13 |
run_transcription = modal.lookup("ffpub-transcription", "run_transcription")
|
14 |
|
15 |
st.set_page_config(page_title="Speech to Text Transcription App")
|
|
|
21 |
|
22 |
|
23 |
def password_is_correct(password):
|
24 |
+
return password in PASSWORDS or password in ROOT_PASSWORDS
|
25 |
|
26 |
|
27 |
def input_is_ready(password, audio_file, url):
|
|
|
78 |
# with st.expander(("Audio" if audio_file else "Video") + " abspielen"):
|
79 |
if audio_file:
|
80 |
st.audio(audio_file)
|
81 |
+
cutoff = None if password in ROOT_PASSWORDS else 60_000
|
82 |
audio_file = AudioSegment.from_file(audio_file)[:cutoff]
|
83 |
audio_b64 = base64.b64encode(audio_file.export().read()).decode("ascii")
|
84 |
if url:
|