Kangarroar commited on
Commit
95ec93c
1 Parent(s): 3ce3c7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -27,7 +27,7 @@ from infer_tools.infer_tool import *
27
  import io
28
 
29
  clip_completed = False
30
- def render_audio(ckpt_temp_file, config_temp_file, audio_temp_file, title, title2, Crepe, noise_step, use_mel_as_base):
31
  logging.getLogger('numba').setLevel(logging.WARNING)
32
  title = int(title)
33
  title2 = int(title2)
@@ -47,7 +47,7 @@ def render_audio(ckpt_temp_file, config_temp_file, audio_temp_file, title, title
47
 
48
  # Show the spinner and run the run_clip function inside the 'with' block
49
  with st.spinner("Rendering Audio..."):
50
- f0_tst, f0_pred, audio = run_clip(svc_model,file_path=wav_fn, key=key, acc=title2, use_crepe=Crepe, use_pe=False, thre=0.05,
51
  use_gt_mel=use_mel_as_base, add_noise_step=noise_step,project_name=project_name,out_path=wav_gen)
52
  clip_completed = True
53
  if clip_completed:
@@ -112,7 +112,7 @@ if "audio_temp_file" in locals():
112
  title = col2.number_input("Key", value=0, step=1, min_value=-12, max_value=12)
113
  title2 = col2.number_input("Speedup", value=20, step=1, min_value=5, max_value=100)
114
  title3 = col2.number_input("Gender Flag", value=1.00, step=0.01, min_value=0.70, max_value=1.30, help='Default is 1.0, it works by decimals, setting it at 1.05 will make your render sound more female-ish, setting it to 0.95 will make it sound more masculine, for example.')
115
- choice = col2.selectbox('Resampler', ('Crepe', 'Harvest'))
116
  # Create checkbox for using Mel as Base
117
  use_mel_as_base = col2.checkbox('Use Mel as Base', value=False, help='gt mel: Enabling this will use the input audio as a base and will unlock a new parameter, do not use this if you dont know what it does.')
118
  noise_step = 600
@@ -123,15 +123,10 @@ else:
123
  noise_step = 600
124
  password = col2.text_input("Enter password", help='Password can be got by agreeing to TOS and getting allowed after validation, you can go to the TOS here:')
125
  correct_password = os.environ.get("gatepassword")
126
- if choice == Crepe
127
- Crepe = True
128
- else:
129
- Crepe = False
130
-
131
  ###
132
  if st.button("Render audio"):
133
  if password == correct_password:
134
- render_audio(ckpt_temp_file, config_temp_file, audio_temp_file, title, title2, noise_step, Crepe, use_mel_as_base)
135
 
136
  else:
137
  st.error("Incorrect password")
 
27
  import io
28
 
29
  clip_completed = False
30
+ def render_audio(ckpt_temp_file, config_temp_file, audio_temp_file, title, title2, choice, noise_step, use_mel_as_base):
31
  logging.getLogger('numba').setLevel(logging.WARNING)
32
  title = int(title)
33
  title2 = int(title2)
 
47
 
48
  # Show the spinner and run the run_clip function inside the 'with' block
49
  with st.spinner("Rendering Audio..."):
50
+ f0_tst, f0_pred, audio = run_clip(svc_model,file_path=wav_fn, key=key, acc=title2, use_crepe=choice, use_pe=False, thre=0.05,
51
  use_gt_mel=use_mel_as_base, add_noise_step=noise_step,project_name=project_name,out_path=wav_gen)
52
  clip_completed = True
53
  if clip_completed:
 
112
  title = col2.number_input("Key", value=0, step=1, min_value=-12, max_value=12)
113
  title2 = col2.number_input("Speedup", value=20, step=1, min_value=5, max_value=100)
114
  title3 = col2.number_input("Gender Flag", value=1.00, step=0.01, min_value=0.70, max_value=1.30, help='Default is 1.0, it works by decimals, setting it at 1.05 will make your render sound more female-ish, setting it to 0.95 will make it sound more masculine, for example.')
115
+ choice = col2.checkbox('Use Crepe', value=False)
116
  # Create checkbox for using Mel as Base
117
  use_mel_as_base = col2.checkbox('Use Mel as Base', value=False, help='gt mel: Enabling this will use the input audio as a base and will unlock a new parameter, do not use this if you dont know what it does.')
118
  noise_step = 600
 
123
  noise_step = 600
124
  password = col2.text_input("Enter password", help='Password can be got by agreeing to TOS and getting allowed after validation, you can go to the TOS here:')
125
  correct_password = os.environ.get("gatepassword")
 
 
 
 
 
126
  ###
127
  if st.button("Render audio"):
128
  if password == correct_password:
129
+ render_audio(ckpt_temp_file, config_temp_file, audio_temp_file, title, title2, noise_step, choice, use_mel_as_base)
130
 
131
  else:
132
  st.error("Incorrect password")