Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,14 @@ import gradio as gr
|
|
3 |
from scipy.io.wavfile import write, read
|
4 |
import subprocess
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# Erstellen eines Ausgabeordners, falls nicht vorhanden
|
8 |
os.makedirs("out", exist_ok=True)
|
9 |
|
@@ -39,7 +46,7 @@ article = "Inspired by</p>"
|
|
39 |
# Gradio Interface
|
40 |
demo = gr.Interface(
|
41 |
fn=inference,
|
42 |
-
inputs=gr.Audio(type="numpy", label="Input"),
|
43 |
outputs=[
|
44 |
gr.Audio(type="filepath", label="Vocals"),
|
45 |
gr.Audio(type="filepath", label="Bass"),
|
|
|
3 |
from scipy.io.wavfile import write, read
|
4 |
import subprocess
|
5 |
|
6 |
+
# Laden des Passworts aus der Umgebungsvariable
|
7 |
+
correct_password = os.getenv("MY_PASSWORD")
|
8 |
+
|
9 |
+
def inference(password, audio):
|
10 |
+
# Überprüfen, ob das eingegebene Passwort korrekt ist
|
11 |
+
if password != correct_password:
|
12 |
+
return ["Falsches Passwort! Zugriff verweigert."] * 4
|
13 |
+
|
14 |
# Erstellen eines Ausgabeordners, falls nicht vorhanden
|
15 |
os.makedirs("out", exist_ok=True)
|
16 |
|
|
|
46 |
# Gradio Interface
|
47 |
demo = gr.Interface(
|
48 |
fn=inference,
|
49 |
+
inputs=[gr.Textbox(label="Passwort"), gr.Audio(type="numpy", label="Input")],
|
50 |
outputs=[
|
51 |
gr.Audio(type="filepath", label="Vocals"),
|
52 |
gr.Audio(type="filepath", label="Bass"),
|