Skip to content

Commit

Permalink
improve extra and settings tab
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Dec 21, 2024
1 parent fe05363 commit 7e491c1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 47 deletions.
14 changes: 4 additions & 10 deletions tabs/extra/extra.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
import gradio as gr

import os
import sys
import gradio as gr

now_dir = os.getcwd()
sys.path.append(now_dir)

from tabs.extra.processing.processing import processing_tab
from tabs.extra.analyzer.analyzer import analyzer_tab
from tabs.extra.f0_extractor.f0_extractor import f0_extractor_tab
from tabs.extra.sections.processing import processing_tab
from tabs.extra.sections.analyzer import analyzer_tab
from tabs.extra.sections.f0_extractor import f0_extractor_tab

from assets.i18n.i18n import I18nAuto

i18n = I18nAuto()


def extra_tab():
gr.Markdown(
value=i18n(
"This section contains some extra utilities that often may be in experimental phases."
)
)
with gr.TabItem(i18n("Model information")):
processing_tab()

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import librosa
import gradio as gr
import os
from matplotlib import pyplot as plt

from rvc.lib.predictors.F0Extractor import F0Extractor
Expand Down Expand Up @@ -41,28 +41,26 @@ def extract_f0_curve(audio_path: str, method: str):


def f0_extractor_tab():
with gr.Accordion(label=i18n("Extract F0 Curve")):
with gr.Row():
audio = gr.Audio(label=i18n("Upload Audio"), type="filepath")
f0_method = gr.Radio(
label=i18n("Pitch extraction algorithm"),
info=i18n(
"Pitch extraction algorithm to use for the audio conversion. The default algorithm is rmvpe, which is recommended for most cases."
),
choices=["crepe", "fcpe", "rmvpe"],
value="rmvpe",
)
button = gr.Button(i18n("Extract F0 Curve"))
audio = gr.Audio(label=i18n("Upload Audio"), type="filepath")
f0_method = gr.Radio(
label=i18n("Pitch extraction algorithm"),
info=i18n(
"Pitch extraction algorithm to use for the audio conversion. The default algorithm is rmvpe, which is recommended for most cases."
),
choices=["crepe", "fcpe", "rmvpe"],
value="rmvpe",
)
button = gr.Button(i18n("Extract F0 Curve"))

with gr.Accordion(label=i18n("Output Information")):
with gr.Row():
txt_output = gr.File(label="F0 Curve", type="filepath")
image_output = gr.Image(type="filepath", interactive=False)

button.click(
fn=extract_f0_curve,
inputs=[
audio,
f0_method,
],
outputs=[image_output, txt_output],
)
button.click(
fn=extract_f0_curve,
inputs=[
audio,
f0_method,
],
outputs=[image_output, txt_output],
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os, sys
import os
import sys
import gradio as gr

now_dir = os.getcwd()
sys.path.append(now_dir)
Expand All @@ -8,14 +10,8 @@

i18n = I18nAuto()

import gradio as gr


def processing_tab():
with gr.Accordion(label=i18n("View model information")):
with gr.Row():
with gr.Column():
model_view_model_path = gr.Textbox(
model_view_model_path = gr.Textbox(
label=i18n("Path to Model"),
info=i18n("Introduce the model pth path"),
value="",
Expand Down
17 changes: 10 additions & 7 deletions tabs/settings/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
import gradio as gr

now_dir = os.getcwd()
sys.path.append(now_dir)
Expand All @@ -14,10 +15,12 @@


def settings_tab():
presence_tab()
precision_tab()
theme_tab()
version_tab()
lang_tab()
restart_tab()
model_author_tab()
with gr.TabItem(label="General"):
presence_tab()
theme_tab()
version_tab()
lang_tab()
restart_tab()
with gr.TabItem(label="Inference & Training"):
precision_tab()
model_author_tab()

0 comments on commit 7e491c1

Please sign in to comment.