Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import os
|
|
5 |
|
6 |
RUNPOD_API = os.environ.get("RUNPOD_API")
|
7 |
RUNPOD_ENDPOINT = os.environ.get("RUNPOD_ENDPOINT")
|
|
|
8 |
|
9 |
def update_message(request: gr.Request):
|
10 |
return f"Welcome, {request.username}"
|
@@ -26,6 +27,7 @@ def process_transcribe(file):
|
|
26 |
with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as iface:
|
27 |
m = gr.Markdown()
|
28 |
iface.load(update_message, None, m)
|
|
|
29 |
with gr.Tab("Speech2text prescription"):
|
30 |
with gr.Row():
|
31 |
with gr.Column():
|
@@ -34,4 +36,4 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as iface:
|
|
34 |
with gr.Column():
|
35 |
raw_transcript = gr.Textbox(label="Transcription")
|
36 |
submit_btn.click(process_transcribe, inputs=[audio_file], outputs=[raw_transcript])
|
37 |
-
iface.launch(auth
|
|
|
5 |
|
6 |
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 update_message(request: gr.Request):
|
11 |
return f"Welcome, {request.username}"
|
|
|
27 |
with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as iface:
|
28 |
m = gr.Markdown()
|
29 |
iface.load(update_message, None, m)
|
30 |
+
logout_button = gr.Button("Logout", link="/logout")
|
31 |
with gr.Tab("Speech2text prescription"):
|
32 |
with gr.Row():
|
33 |
with gr.Column():
|
|
|
36 |
with gr.Column():
|
37 |
raw_transcript = gr.Textbox(label="Transcription")
|
38 |
submit_btn.click(process_transcribe, inputs=[audio_file], outputs=[raw_transcript])
|
39 |
+
iface.launch(auth)
|