BlahBlah314 commited on
Commit
9ce0c60
·
verified ·
1 Parent(s): a79f63f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
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 user(request: gr.Request):
11
- return request.username
12
 
13
  def doDebug(request):
14
  debug = False
@@ -33,20 +33,15 @@ def process_transcribe(file):
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:
49
- transcript = gr.Textbox(label="Transcription")
50
  submit_btn.click(process_transcribe, inputs=[audio_file], outputs=[transcript])
51
  logout_button = gr.Button("Logout", link="/logout")
52
  iface.launch(auth=auth)
 
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 welcome_user(request: gr.Request):
11
+ return f"Bienvenue {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
+ m = gr.Markdown()
37
+ iface.load(welcome_user, None, m)
 
38
  with gr.Tab("Speech2text prescription"):
39
  with gr.Row():
40
  with gr.Column():
41
  audio_file = gr.Audio(sources=["upload", "microphone"], type="numpy", label="Audio")
42
  submit_btn = gr.Button("Submit", variant="primary")
43
  with gr.Column():
44
+ transcript = gr.Textbox(label="Transcription")
 
 
 
 
45
  submit_btn.click(process_transcribe, inputs=[audio_file], outputs=[transcript])
46
  logout_button = gr.Button("Logout", link="/logout")
47
  iface.launch(auth=auth)