Applio-V3 / app.py
freshyfresco's picture
Update app.py
65a6a6f verified
raw
history blame
3.16 kB
from __future__ import annotations
from typing import Iterable
import gradio as gr
import sys
import os
from assets.i18n.i18n import I18nAuto
from tabs.inference.inference import inference_tab
from tabs.train.train import train_tab
from tabs.extra.extra import extra_tab
from tabs.report.report import report_tab
from tabs.download.download import download_tab
from tabs.tts.tts import tts_tab
from assets.discord_presence import rich_presence
from gradio.themes.base import Base
from gradio.themes.utils import colors, fonts, sizes
now_dir = os.getcwd()
sys.path.append(now_dir)
i18n = I18nAuto()
rich_presence()
class Applio(Base):
def __init__(
self,
*,
primary_hue: colors.Color | str = colors.green,
secondary_hue: colors.Color | str = colors.emerald,
neutral_hue: colors.Color | str = colors.neutral,
spacing_size: sizes.Size | str = sizes.spacing_md,
radius_size: sizes.Size | str = sizes.radius_md,
text_size: sizes.Size | str = sizes.text_lg,
font: fonts.Font
| str
| Iterable[fonts.Font | str] = (
'Inter V',
fonts.GoogleFont('Inter'),
'ui-sans-serif',
'system-ui',
),
font_mono: fonts.Font
| str
| Iterable[fonts.Font | str] = (
'ui-monospace',
fonts.GoogleFont("Roboto Mono"),
'Consolas',
'monospace',
),
chatbot_code_background_color: colors.Color | str = colors.black, # Added missing setting
):
super().__init__(
primary_hue=primary_hue,
secondary_hue=secondary_hue,
neutral_hue=neutral_hue,
spacing_size=spacing_size,
radius_size=radius_size,
text_size=text_size,
font=font,
font_mono=font_mono,
)
# Additional settings
self.chatbot_code_background_color = chatbot_code_background_color
# Rest of your theme settings...
self.name = "Applio"
self.secondary_100 = "#dbeafe"
# ... (other settings)
# Define the Gradio application
with gr.Blocks(theme=Applio(), title="Applio") as ApplioApp:
gr.Markdown("# Applio")
gr.Markdown(
i18n(
"Ultimate voice cloning tool, meticulously optimized for unrivaled power, modularity, and user-friendly experience."
)
)
gr.Markdown(
i18n(
"[Support](https://discord.gg/IAHispano) β€” [Discord Bot](https://discord.com/oauth2/authorize?client_id=1144714449563955302&permissions=1376674695271&scope=bot%20applications.commands) β€” [Find Voices](https://applio.org/models) β€” [GitHub](https://github.com/IAHispano/Applio)"
)
)
with gr.Tab(i18n("Inference")):
inference_tab()
with gr.Tab(i18n("Train")):
train_tab()
with gr.Tab(i18n("TTS")):
tts_tab()
with gr.Tab(i18n("Extra")):
extra_tab()
with gr.Tab(i18n("Download")):
download_tab()
with gr.Tab(i18n("Report a Bug")):
report_tab()
if __name__ == "__main__":
ApplioApp.launch()
# share=True