File size: 1,633 Bytes
1c7d911 d7d0dc0 555558e d7d0dc0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
import argparse
import logging
import os
import sys
import os
from functools import lru_cache
import gradio as gr
# non module import
from tabs.typing_extra import ALLOWED_DIR, CONFIG
import assets.theme.loadThemes as loadThemes
from assets.theme.applio import Applio
from tabs.infer.infer import inference_tab
from tabs.models.model import download_tab, model_manage_tab
from tabs.help.help import help_tab
# Configure logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s",
handlers=[logging.StreamHandler(), logging.FileHandler('neorvc.log')]
)
logger = logging.getLogger(__name__)
# Base directory setup
BASE_DIR = os.getcwd()
sys.path.append(BASE_DIR)
def build_ui():
"""Build the Gradio UI with separated tab functions."""
with gr.Blocks(
title="Neo RVC",
theme=Applio(),
fill_height=True,
) as app:
gr.Markdown("# Neo RVC: AI Voice extension")
status_message = gr.Textbox(
label="Status",
lines=2,
interactive=False,
elem_classes=["success", "error"],
visible=False
)
# Placeholder for rvc_model to be shared across tabs
rvc_model = gr.State(value=None)
with gr.Tabs():
rvc_model = inference_tab(status_message, rvc_model)
with gr.TabItem("Models Options"):
download_tab(status_message, rvc_model)
model_manage_tab(status_message, rvc_model)
help_tab()
return app
app = build_ui()
app.queue()
app.launch(allowed_paths=[ALLOWED_DIR]) |