Blane187 commited on
Commit
0a65394
1 Parent(s): f571c10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -44
app.py CHANGED
@@ -1,44 +1,7 @@
1
  import wave
2
  import gradio as gr
3
 
4
- pretrains = {
5
- "OV2-32k": {
6
- "D": "https://huggingface.co/poiqazwsx/Ov2Super32kfix/resolve/main/f0Ov2Super32kD.pth",
7
- "G": "https://huggingface.co/poiqazwsx/Ov2Super32kfix/resolve/main/f0Ov2Super32kG.pth"
8
- },
9
- "OV2-40k": {
10
- "D": "https://huggingface.co/ORVC/Ov2Super/resolve/main/f0Ov2Super40kD.pth",
11
- "G": "https://huggingface.co/ORVC/Ov2Super/resolve/main/f0Ov2Super40kG.pth"
12
- },
13
- "RIN-40k": {
14
- "D": "https://huggingface.co/ORVC/RIN_E3/resolve/main/RIN_E3_D.pth",
15
- "G": "https://huggingface.co/ORVC/RIN_E3/resolve/main/RIN_E3_G.pth"
16
- },
17
- "Snowie-40k": {
18
- "D": "https://huggingface.co/ORVC/Snowie_RuPretrain_40k/resolve/main/D_Snowie_RuPretrain_EnP.pth",
19
- "G": "https://huggingface.co/ORVC/Snowie_RuPretrain_40k/resolve/main/G_Snowie_RuPretrain_EnP.pth"
20
- },
21
- "Snowie-48k": {
22
- "D": "https://huggingface.co/ORVC/Snowie_RuPretrain_48k/resolve/main/D_Snowie_Rupretrain_48k_V1.2.pth",
23
- "G": "https://huggingface.co/ORVC/Snowie_RuPretrain_48k/resolve/main/G_Snowie_Rupretrain_48k_V1.2.pth"
24
- },
25
- "SnowieV3.1-40k": {
26
- "D": "https://huggingface.co/MUSTAR/SnowieV3.1-40k/resolve/main/D_SnowieV3.1_40k.pth",
27
- "G": "https://huggingface.co/MUSTAR/SnowieV3.1-40k/resolve/main/G_SnowieV3.1_40k.pth"
28
- },
29
- "SnowieV3.1-32k": {
30
- "D": "https://huggingface.co/MUSTAR/SnowieV3.1-32k/resolve/main/D_SnowieV3.1_32k.pth",
31
- "G": "https://huggingface.co/MUSTAR/SnowieV3.1-32k/resolve/main/G_SnowieV3.1_32k.pth"
32
- },
33
- "SnowieV3.1-48k": {
34
- "D": "https://huggingface.co/MUSTAR/SnowieV3.1-48k/resolve/main/D_SnowieV3.1_48k.pth",
35
- "G": "https://huggingface.co/MUSTAR/SnowieV3.1-48k/resolve/main/G_SnowieV3.1_48k.pth"
36
- },
37
- "SnowieV3.1-X-RinE3-40k": {
38
- "D": "https://huggingface.co/MUSTAR/SnowieV3.1-X-RinE3-40K/resolve/main/D_Snowie-X-Rin_40k.pth",
39
- "G": "https://huggingface.co/MUSTAR/SnowieV3.1-X-RinE3-40K/resolve/main/G_Snowie-X-Rin_40k.pth"
40
- }
41
- }
42
 
43
  def get_audio_duration(audio_file):
44
  with wave.open(audio_file, 'rb') as audio:
@@ -49,7 +12,7 @@ def get_audio_duration(audio_file):
49
 
50
  def get_training_info(audio_file):
51
  if audio_file is None:
52
- return 'Please provide an audio file!'
53
 
54
  duration = get_audio_duration(audio_file)
55
  sample_rate = wave.open(audio_file, 'rb').getframerate()
@@ -73,9 +36,13 @@ def get_training_info(audio_file):
73
  return f'You should use the **{pretrain}** pretrain with **{epochs}** epochs at **{sample_rate/1000}kHz** sample rate. Good luck with your training!'
74
 
75
  with gr.Blocks() as demo:
76
- audio_p = gr.Audio(type="filepath", label="Your Audio here")
77
- audio_q = gr.Textbox(label="Your Output here")
78
- wtar = gr.Button("Start!")
79
- wtar.click(get_training_info, inputs=[audio_p], outputs=[audio_q])
80
-
 
 
 
 
81
  demo.launch(debug=True)
 
1
  import wave
2
  import gradio as gr
3
 
4
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  def get_audio_duration(audio_file):
7
  with wave.open(audio_file, 'rb') as audio:
 
12
 
13
  def get_training_info(audio_file):
14
  if audio_file is None:
15
+ return 'the audio file pls'
16
 
17
  duration = get_audio_duration(audio_file)
18
  sample_rate = wave.open(audio_file, 'rb').getframerate()
 
36
  return f'You should use the **{pretrain}** pretrain with **{epochs}** epochs at **{sample_rate/1000}kHz** sample rate. Good luck with your training!'
37
 
38
  with gr.Blocks() as demo:
39
+ with gr.Tab("Main Settings"):
40
+ audio_p = gr.Audio(type="filepath", label="Your Audio here")
41
+ wtar = gr.Button("Start!")
42
+ audio_q = gr.Textbox(label="Your Output here", scale=3)
43
+ wtar.click(get_training_info, inputs=[audio_p], outputs=[audio_q])
44
+ with gr.Tab("Credits"):
45
+ gr.Markdown(" This code Originaly by [TheStinger](https://huggingface.co/TheStinger)")
46
+
47
+
48
  demo.launch(debug=True)