Spaces:
Running
on
Zero
Running
on
Zero
mrfakename
commited on
Commit
•
4a7a0b1
1
Parent(s):
3f5b3b4
Sync from GitHub repo
Browse filesThis Space is synced from the GitHub repo: https://github.com/SWivid/F5-TTS. Please submit contributions to the Space there
src/f5_tts/train/finetune_gradio.py
CHANGED
@@ -663,12 +663,14 @@ def calculate_train(
|
|
663 |
|
664 |
num_warmup_updates = int(samples * 0.05)
|
665 |
save_per_updates = int(samples * 0.10)
|
666 |
-
last_per_steps = int(save_per_updates *
|
667 |
|
668 |
max_samples = (lambda num: num + 1 if num % 2 != 0 else num)(max_samples)
|
669 |
num_warmup_updates = (lambda num: num + 1 if num % 2 != 0 else num)(num_warmup_updates)
|
670 |
save_per_updates = (lambda num: num + 1 if num % 2 != 0 else num)(save_per_updates)
|
671 |
last_per_steps = (lambda num: num + 1 if num % 2 != 0 else num)(last_per_steps)
|
|
|
|
|
672 |
|
673 |
total_hours = hours
|
674 |
mel_hop_length = 256
|
@@ -1046,7 +1048,19 @@ for tutorial and updates check here (https://github.com/SWivid/F5-TTS/discussion
|
|
1046 |
fn=get_random_sample_prepare, inputs=[cm_project], outputs=[random_text_prepare, random_audio_prepare]
|
1047 |
)
|
1048 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1049 |
with gr.TabItem("train Data"):
|
|
|
|
|
|
|
|
|
1050 |
with gr.Row():
|
1051 |
bt_calculate = bt_create = gr.Button("Auto Settings")
|
1052 |
lb_samples = gr.Label(label="samples")
|
@@ -1136,23 +1150,6 @@ for tutorial and updates check here (https://github.com/SWivid/F5-TTS/discussion
|
|
1136 |
check_finetune, inputs=[ch_finetune], outputs=[file_checkpoint_train, tokenizer_file, tokenizer_type]
|
1137 |
)
|
1138 |
|
1139 |
-
with gr.TabItem("reduse checkpoint"):
|
1140 |
-
txt_path_checkpoint = gr.Text(label="path checkpoint :")
|
1141 |
-
txt_path_checkpoint_small = gr.Text(label="path output :")
|
1142 |
-
ch_safetensors = gr.Checkbox(label="safetensors", value="")
|
1143 |
-
txt_info_reduse = gr.Text(label="info", value="")
|
1144 |
-
reduse_button = gr.Button("reduse")
|
1145 |
-
reduse_button.click(
|
1146 |
-
fn=extract_and_save_ema_model,
|
1147 |
-
inputs=[txt_path_checkpoint, txt_path_checkpoint_small, ch_safetensors],
|
1148 |
-
outputs=[txt_info_reduse],
|
1149 |
-
)
|
1150 |
-
|
1151 |
-
with gr.TabItem("vocab check"):
|
1152 |
-
check_button = gr.Button("check vocab")
|
1153 |
-
txt_info_check = gr.Text(label="info", value="")
|
1154 |
-
check_button.click(fn=vocab_check, inputs=[cm_project], outputs=[txt_info_check])
|
1155 |
-
|
1156 |
with gr.TabItem("test model"):
|
1157 |
exp_name = gr.Radio(label="Model", choices=["F5-TTS", "E2-TTS"], value="F5-TTS")
|
1158 |
list_checkpoints, checkpoint_select = get_checkpoints_project(projects_selelect, False)
|
@@ -1189,6 +1186,21 @@ for tutorial and updates check here (https://github.com/SWivid/F5-TTS/discussion
|
|
1189 |
bt_checkpoint_refresh.click(fn=get_checkpoints_project, inputs=[cm_project], outputs=[cm_checkpoint])
|
1190 |
cm_project.change(fn=get_checkpoints_project, inputs=[cm_project], outputs=[cm_checkpoint])
|
1191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1192 |
with gr.TabItem("system info"):
|
1193 |
output_box = gr.Textbox(label="GPU and CPU Information", lines=20)
|
1194 |
|
|
|
663 |
|
664 |
num_warmup_updates = int(samples * 0.05)
|
665 |
save_per_updates = int(samples * 0.10)
|
666 |
+
last_per_steps = int(save_per_updates * 0.25)
|
667 |
|
668 |
max_samples = (lambda num: num + 1 if num % 2 != 0 else num)(max_samples)
|
669 |
num_warmup_updates = (lambda num: num + 1 if num % 2 != 0 else num)(num_warmup_updates)
|
670 |
save_per_updates = (lambda num: num + 1 if num % 2 != 0 else num)(save_per_updates)
|
671 |
last_per_steps = (lambda num: num + 1 if num % 2 != 0 else num)(last_per_steps)
|
672 |
+
if last_per_steps <= 0:
|
673 |
+
last_per_steps = 2
|
674 |
|
675 |
total_hours = hours
|
676 |
mel_hop_length = 256
|
|
|
1048 |
fn=get_random_sample_prepare, inputs=[cm_project], outputs=[random_text_prepare, random_audio_prepare]
|
1049 |
)
|
1050 |
|
1051 |
+
with gr.TabItem("vocab check"):
|
1052 |
+
gr.Markdown("""```plaintext
|
1053 |
+
check the vocabulary for fine-tuning Emilia_ZH_EN to ensure all symbols are included. for finetune new language
|
1054 |
+
```""")
|
1055 |
+
check_button = gr.Button("check vocab")
|
1056 |
+
txt_info_check = gr.Text(label="info", value="")
|
1057 |
+
check_button.click(fn=vocab_check, inputs=[cm_project], outputs=[txt_info_check])
|
1058 |
+
|
1059 |
with gr.TabItem("train Data"):
|
1060 |
+
gr.Markdown("""```plaintext
|
1061 |
+
The auto-setting is still experimental. Please make sure that the epochs , save per updates , and last per steps are set correctly, or change them manually as needed.
|
1062 |
+
If you encounter a memory error, try reducing the batch size per GPU to a smaller number.
|
1063 |
+
```""")
|
1064 |
with gr.Row():
|
1065 |
bt_calculate = bt_create = gr.Button("Auto Settings")
|
1066 |
lb_samples = gr.Label(label="samples")
|
|
|
1150 |
check_finetune, inputs=[ch_finetune], outputs=[file_checkpoint_train, tokenizer_file, tokenizer_type]
|
1151 |
)
|
1152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1153 |
with gr.TabItem("test model"):
|
1154 |
exp_name = gr.Radio(label="Model", choices=["F5-TTS", "E2-TTS"], value="F5-TTS")
|
1155 |
list_checkpoints, checkpoint_select = get_checkpoints_project(projects_selelect, False)
|
|
|
1186 |
bt_checkpoint_refresh.click(fn=get_checkpoints_project, inputs=[cm_project], outputs=[cm_checkpoint])
|
1187 |
cm_project.change(fn=get_checkpoints_project, inputs=[cm_project], outputs=[cm_checkpoint])
|
1188 |
|
1189 |
+
with gr.TabItem("reduse checkpoint"):
|
1190 |
+
gr.Markdown("""```plaintext
|
1191 |
+
Reduce the model size from 5GB to 1.3GB. The new checkpoint can be used for inference or fine-tuning afterward, but it cannot be used to continue training..
|
1192 |
+
```""")
|
1193 |
+
txt_path_checkpoint = gr.Text(label="path checkpoint :")
|
1194 |
+
txt_path_checkpoint_small = gr.Text(label="path output :")
|
1195 |
+
ch_safetensors = gr.Checkbox(label="safetensors", value="")
|
1196 |
+
txt_info_reduse = gr.Text(label="info", value="")
|
1197 |
+
reduse_button = gr.Button("reduse")
|
1198 |
+
reduse_button.click(
|
1199 |
+
fn=extract_and_save_ema_model,
|
1200 |
+
inputs=[txt_path_checkpoint, txt_path_checkpoint_small, ch_safetensors],
|
1201 |
+
outputs=[txt_info_reduse],
|
1202 |
+
)
|
1203 |
+
|
1204 |
with gr.TabItem("system info"):
|
1205 |
output_box = gr.Textbox(label="GPU and CPU Information", lines=20)
|
1206 |
|