Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,8 @@ RUNPOD_API = os.environ.get("RUNPOD_API")
|
|
7 |
RUNPOD_ENDPOINT = os.environ.get("RUNPOD_ENDPOINT")
|
8 |
auth = [(os.environ.get("S2S_USER"), os.environ.get("S2S_PW")), (os.environ.get("POSOS_USER"), os.environ.get("POSOS_PW"))]
|
9 |
|
10 |
-
def
|
11 |
-
return
|
12 |
|
13 |
def doDebug(request):
|
14 |
debug = False
|
@@ -33,17 +33,16 @@ def process_transcribe(file):
|
|
33 |
return raw_text
|
34 |
|
35 |
with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as iface:
|
36 |
-
|
37 |
-
iface.load(
|
38 |
-
|
39 |
-
print(request.username)
|
40 |
with gr.Tab("Speech2text prescription"):
|
41 |
with gr.Row():
|
42 |
with gr.Column():
|
43 |
audio_file = gr.Audio(sources=["upload", "microphone"], type="numpy", label="Audio")
|
44 |
submit_btn = gr.Button("Submit", variant="primary")
|
45 |
with gr.Column():
|
46 |
-
if
|
47 |
debug_transcript = gr.Textbox(label="Transcription Debug")
|
48 |
transcript = gr.Textbox(label="Transcription")
|
49 |
else:
|
|
|
7 |
RUNPOD_ENDPOINT = os.environ.get("RUNPOD_ENDPOINT")
|
8 |
auth = [(os.environ.get("S2S_USER"), os.environ.get("S2S_PW")), (os.environ.get("POSOS_USER"), os.environ.get("POSOS_PW"))]
|
9 |
|
10 |
+
def user(request: gr.Request):
|
11 |
+
return request.username
|
12 |
|
13 |
def doDebug(request):
|
14 |
debug = False
|
|
|
33 |
return raw_text
|
34 |
|
35 |
with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as iface:
|
36 |
+
user = ""
|
37 |
+
iface.load(user, None, user)
|
38 |
+
print(user)
|
|
|
39 |
with gr.Tab("Speech2text prescription"):
|
40 |
with gr.Row():
|
41 |
with gr.Column():
|
42 |
audio_file = gr.Audio(sources=["upload", "microphone"], type="numpy", label="Audio")
|
43 |
submit_btn = gr.Button("Submit", variant="primary")
|
44 |
with gr.Column():
|
45 |
+
if user == os.environ.get("S2S_USER"):
|
46 |
debug_transcript = gr.Textbox(label="Transcription Debug")
|
47 |
transcript = gr.Textbox(label="Transcription")
|
48 |
else:
|