TIMBOVILL commited on
Commit
a152a0a
1 Parent(s): 5d03fef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -8,24 +8,29 @@ def run_ultrasinger(opt_i, opt_o, mode, transcription, pitcher, extra, device):
8
 
9
  # Add options
10
  if opt_i:
11
- cmd.extend(["-i", opt_i])
12
  if opt_o:
13
  cmd.extend(["-o", opt_o])
14
 
15
  # Add mode
16
- cmd.extend(mode.split())
 
17
 
18
  # Add transcription options
19
- cmd.extend(transcription.split())
 
20
 
21
  # Add pitcher options
22
- cmd.extend(pitcher.split())
 
23
 
24
  # Add extra options
25
- cmd.extend(extra.split())
 
26
 
27
  # Add device options
28
- cmd.extend(device.split())
 
29
 
30
  # Execute the command
31
  try:
@@ -43,8 +48,8 @@ pitcher = gr.Textbox(label="Pitcher options (e.g., --crepe full)")
43
  extra = gr.Textbox(label="Extra options (e.g., --hyphenation True)")
44
  device = gr.Textbox(label="Device options (e.g., --force_cpu False)")
45
 
46
- output_text = gr.outputs.Textbox(label="Standard Output")
47
- error_text = gr.outputs.Textbox(label="Error Output")
48
 
49
  # Create Gradio interface
50
  interface = gr.Interface(
 
8
 
9
  # Add options
10
  if opt_i:
11
+ cmd.extend(["-i", opt_i.name])
12
  if opt_o:
13
  cmd.extend(["-o", opt_o])
14
 
15
  # Add mode
16
+ if mode:
17
+ cmd.extend(mode.split())
18
 
19
  # Add transcription options
20
+ if transcription:
21
+ cmd.extend(transcription.split())
22
 
23
  # Add pitcher options
24
+ if pitcher:
25
+ cmd.extend(pitcher.split())
26
 
27
  # Add extra options
28
+ if extra:
29
+ cmd.extend(extra.split())
30
 
31
  # Add device options
32
+ if device:
33
+ cmd.extend(device.split())
34
 
35
  # Execute the command
36
  try:
 
48
  extra = gr.Textbox(label="Extra options (e.g., --hyphenation True)")
49
  device = gr.Textbox(label="Device options (e.g., --force_cpu False)")
50
 
51
+ output_text = gr.Textbox(label="Standard Output")
52
+ error_text = gr.Textbox(label="Error Output")
53
 
54
  # Create Gradio interface
55
  interface = gr.Interface(