Sync app.py and gitignore; ignore .DS_Store
Browse files- .gitignore +4 -0
- app.py +84 -100
.gitignore
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Python
|
| 2 |
__pycache__/
|
| 3 |
*.py[cod]
|
| 4 |
*.pyo
|
| 5 |
*.pyd
|
| 6 |
*.pyc
|
|
|
|
| 7 |
|
| 8 |
# Virtual environments
|
| 9 |
venv/
|
|
|
|
| 1 |
+
# OS
|
| 2 |
+
.DS_Store
|
| 3 |
+
|
| 4 |
# Python
|
| 5 |
__pycache__/
|
| 6 |
*.py[cod]
|
| 7 |
*.pyo
|
| 8 |
*.pyd
|
| 9 |
*.pyc
|
| 10 |
+
onnx_models
|
| 11 |
|
| 12 |
# Virtual environments
|
| 13 |
venv/
|
app.py
CHANGED
|
@@ -863,135 +863,114 @@ body, .gradio-container {
|
|
| 863 |
outline: none !important;
|
| 864 |
box-shadow: 0 0 0 3px rgba(96,165,250,0.1) !important;
|
| 865 |
}
|
| 866 |
-
|
| 867 |
-
.gradio-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
.controls-row {
|
| 871 |
-
margin-top: 1.25rem;
|
| 872 |
-
display: grid !important;
|
| 873 |
-
grid-template-columns: repeat(4, 1fr) !important;
|
| 874 |
-
gap: 0.75rem !important;
|
| 875 |
-
align-items: start !important;
|
| 876 |
-
}
|
| 877 |
-
/* Remove any Gradio flex overrides inside the row */
|
| 878 |
-
.controls-row > div,
|
| 879 |
-
.controls-row > div > div { all: unset; display: contents; }
|
| 880 |
-
|
| 881 |
-
/* Shared label style for all four controls */
|
| 882 |
-
.controls-row .gradio-dropdown > label > span,
|
| 883 |
-
.controls-row .gradio-radio > fieldset > legend > span,
|
| 884 |
-
.controls-row .gradio-slider > label > span {
|
| 885 |
-
display: block !important;
|
| 886 |
color: #9ca3af !important;
|
| 887 |
font-size: 0.75rem !important;
|
| 888 |
font-weight: 600 !important;
|
| 889 |
text-transform: uppercase !important;
|
| 890 |
letter-spacing: 0.06em !important;
|
| 891 |
-
margin-bottom: 0.4rem !important;
|
| 892 |
-
line-height: 1 !important;
|
| 893 |
}
|
| 894 |
|
| 895 |
-
/*
|
| 896 |
-
.
|
| 897 |
-
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 905 |
}
|
| 906 |
-
.ctrl-surface:focus-within { border-color: #60a5fa; }
|
| 907 |
|
| 908 |
-
/*
|
| 909 |
-
.
|
| 910 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 911 |
background: #0d0d14 !important;
|
| 912 |
border: 1px solid #2a2a3e !important;
|
| 913 |
border-radius: 8px !important;
|
| 914 |
color: #e8e8f0 !important;
|
| 915 |
-
min-height: 42px !important;
|
| 916 |
-
padding: 0 0.75rem !important;
|
| 917 |
-
}
|
| 918 |
-
.controls-row .gradio-dropdown > label > div:focus-within {
|
| 919 |
-
border-color: #60a5fa !important;
|
| 920 |
}
|
| 921 |
|
| 922 |
-
/*
|
| 923 |
-
.
|
| 924 |
-
.controls-row .gradio-radio > fieldset {
|
| 925 |
border: none !important;
|
| 926 |
padding: 0 !important;
|
| 927 |
margin: 0 !important;
|
| 928 |
-
background: transparent !important;
|
| 929 |
}
|
| 930 |
-
.
|
| 931 |
display: flex !important;
|
| 932 |
flex-direction: row !important;
|
| 933 |
-
gap: 0.4rem !important;
|
| 934 |
flex-wrap: wrap !important;
|
|
|
|
|
|
|
| 935 |
}
|
| 936 |
-
.
|
| 937 |
flex: 1 !important;
|
|
|
|
| 938 |
display: flex !important;
|
| 939 |
align-items: center !important;
|
| 940 |
justify-content: center !important;
|
| 941 |
-
height:
|
| 942 |
background: #0d0d14 !important;
|
| 943 |
border: 1px solid #2a2a3e !important;
|
| 944 |
border-radius: 8px !important;
|
| 945 |
cursor: pointer !important;
|
| 946 |
-
transition: border-color 0.
|
| 947 |
-
padding: 0 0.
|
| 948 |
-
|
| 949 |
}
|
| 950 |
-
.
|
| 951 |
-
background: #
|
| 952 |
border-color: #60a5fa !important;
|
| 953 |
}
|
| 954 |
-
.
|
| 955 |
-
|
|
|
|
|
|
|
|
|
|
| 956 |
}
|
| 957 |
-
.
|
| 958 |
color: #c4c4d4 !important;
|
| 959 |
-
font-size: 0.
|
| 960 |
font-weight: 500 !important;
|
| 961 |
text-transform: none !important;
|
| 962 |
letter-spacing: normal !important;
|
|
|
|
| 963 |
}
|
| 964 |
-
.
|
| 965 |
color: #60a5fa !important;
|
| 966 |
}
|
| 967 |
-
|
| 968 |
-
/* Sliders */
|
| 969 |
-
.controls-row .gradio-slider { display: block !important; }
|
| 970 |
-
.controls-row .gradio-slider > label > div {
|
| 971 |
-
background: #0d0d14 !important;
|
| 972 |
-
border: 1px solid #2a2a3e !important;
|
| 973 |
-
border-radius: 8px !important;
|
| 974 |
-
height: 42px !important;
|
| 975 |
-
display: flex !important;
|
| 976 |
-
align-items: center !important;
|
| 977 |
-
padding: 0 0.75rem !important;
|
| 978 |
-
gap: 0.6rem !important;
|
| 979 |
-
}
|
| 980 |
-
.controls-row .gradio-slider > label > div > input[type=range] {
|
| 981 |
-
flex: 1 !important;
|
| 982 |
-
accent-color: #60a5fa !important;
|
| 983 |
-
margin: 0 !important;
|
| 984 |
-
}
|
| 985 |
-
.controls-row .gradio-slider > label > div > input[type=number] {
|
| 986 |
-
background: transparent !important;
|
| 987 |
-
border: none !important;
|
| 988 |
color: #9ca3af !important;
|
| 989 |
-
font-size: 0.
|
| 990 |
-
|
| 991 |
-
text-
|
| 992 |
-
|
| 993 |
}
|
| 994 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 995 |
/* Generate button */
|
| 996 |
.gen-btn {
|
| 997 |
background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
|
|
@@ -1036,14 +1015,13 @@ table.examples td:first-child { border-left: 1px solid #1e1e2e !important; borde
|
|
| 1036 |
table.examples td:last-child { border-right: 1px solid #1e1e2e !important; border-radius: 0 8px 8px 0 !important; }
|
| 1037 |
table.examples tr:hover td { background: #1a1a2e !important; border-color: #2a2a4e !important; color: #e8e8f0 !important; }
|
| 1038 |
|
| 1039 |
-
/* Dropdown
|
| 1040 |
.gradio-dropdown select, .gradio-dropdown input {
|
| 1041 |
-
background: #0d0d14 !important;
|
| 1042 |
-
|
|
|
|
|
|
|
| 1043 |
}
|
| 1044 |
-
.gradio-radio label { color: #c4c4d4 !important; }
|
| 1045 |
-
.gradio-radio input:checked + span { color: #60a5fa !important; }
|
| 1046 |
-
input[type=range] { accent-color: #60a5fa !important; }
|
| 1047 |
|
| 1048 |
/* Responsive */
|
| 1049 |
@media (max-width: 640px) {
|
|
@@ -1069,16 +1047,22 @@ with gr.Blocks(title="BlueTTS โ Multilingual TTS") as demo:
|
|
| 1069 |
value="The power to change begins the moment you believe it's possible!",
|
| 1070 |
)
|
| 1071 |
|
| 1072 |
-
with gr.
|
| 1073 |
-
|
| 1074 |
-
|
| 1075 |
-
|
| 1076 |
-
|
| 1077 |
-
|
| 1078 |
-
|
| 1079 |
-
|
| 1080 |
-
|
| 1081 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1082 |
|
| 1083 |
btn = gr.Button("โก Generate Speech", elem_classes="gen-btn")
|
| 1084 |
|
|
|
|
| 863 |
outline: none !important;
|
| 864 |
box-shadow: 0 0 0 3px rgba(96,165,250,0.1) !important;
|
| 865 |
}
|
| 866 |
+
/* Shared label style */
|
| 867 |
+
.gradio-textbox label span,
|
| 868 |
+
.gradio-dropdown label span,
|
| 869 |
+
.gradio-slider label span {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 870 |
color: #9ca3af !important;
|
| 871 |
font-size: 0.75rem !important;
|
| 872 |
font-weight: 600 !important;
|
| 873 |
text-transform: uppercase !important;
|
| 874 |
letter-spacing: 0.06em !important;
|
|
|
|
|
|
|
| 875 |
}
|
| 876 |
|
| 877 |
+
/* โโ Controls rows โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
|
| 878 |
+
.controls-row {
|
| 879 |
+
margin-top: 1rem;
|
| 880 |
+
display: flex !important;
|
| 881 |
+
flex-direction: column !important;
|
| 882 |
+
gap: 0.75rem !important;
|
| 883 |
+
}
|
| 884 |
+
|
| 885 |
+
/* Row 1: Language + Voice side by side */
|
| 886 |
+
.ctrl-row1,
|
| 887 |
+
.ctrl-row2 {
|
| 888 |
+
display: flex !important;
|
| 889 |
+
flex-direction: row !important;
|
| 890 |
+
gap: 0.75rem !important;
|
| 891 |
+
align-items: flex-start !important;
|
| 892 |
+
width: 100% !important;
|
| 893 |
}
|
|
|
|
| 894 |
|
| 895 |
+
/* Language dropdown takes ~40%, Voice takes ~60% */
|
| 896 |
+
.ctrl-lang { flex: 2 !important; min-width: 0 !important; }
|
| 897 |
+
.ctrl-voice { flex: 3 !important; min-width: 0 !important; }
|
| 898 |
+
|
| 899 |
+
/* Quality + Speed each take 50% */
|
| 900 |
+
.ctrl-steps,
|
| 901 |
+
.ctrl-speed { flex: 1 !important; min-width: 0 !important; }
|
| 902 |
+
|
| 903 |
+
/* Dropdown styling */
|
| 904 |
+
.ctrl-lang .gradio-dropdown > label > div,
|
| 905 |
+
.ctrl-lang .gradio-dropdown > label > div > div {
|
| 906 |
background: #0d0d14 !important;
|
| 907 |
border: 1px solid #2a2a3e !important;
|
| 908 |
border-radius: 8px !important;
|
| 909 |
color: #e8e8f0 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 910 |
}
|
| 911 |
|
| 912 |
+
/* Voice radio โ pill buttons */
|
| 913 |
+
.ctrl-voice .gradio-radio fieldset {
|
|
|
|
| 914 |
border: none !important;
|
| 915 |
padding: 0 !important;
|
| 916 |
margin: 0 !important;
|
|
|
|
| 917 |
}
|
| 918 |
+
.ctrl-voice .gradio-radio fieldset > div {
|
| 919 |
display: flex !important;
|
| 920 |
flex-direction: row !important;
|
|
|
|
| 921 |
flex-wrap: wrap !important;
|
| 922 |
+
gap: 0.4rem !important;
|
| 923 |
+
margin-top: 0.35rem !important;
|
| 924 |
}
|
| 925 |
+
.ctrl-voice .gradio-radio fieldset > div > label {
|
| 926 |
flex: 1 !important;
|
| 927 |
+
min-width: 80px !important;
|
| 928 |
display: flex !important;
|
| 929 |
align-items: center !important;
|
| 930 |
justify-content: center !important;
|
| 931 |
+
height: 36px !important;
|
| 932 |
background: #0d0d14 !important;
|
| 933 |
border: 1px solid #2a2a3e !important;
|
| 934 |
border-radius: 8px !important;
|
| 935 |
cursor: pointer !important;
|
| 936 |
+
transition: border-color 0.15s, background 0.15s !important;
|
| 937 |
+
padding: 0 0.75rem !important;
|
| 938 |
+
gap: 0.4rem !important;
|
| 939 |
}
|
| 940 |
+
.ctrl-voice .gradio-radio fieldset > div > label:has(input:checked) {
|
| 941 |
+
background: #0f1f3d !important;
|
| 942 |
border-color: #60a5fa !important;
|
| 943 |
}
|
| 944 |
+
.ctrl-voice .gradio-radio fieldset > div > label > input[type=radio] {
|
| 945 |
+
width: 14px !important;
|
| 946 |
+
height: 14px !important;
|
| 947 |
+
accent-color: #60a5fa !important;
|
| 948 |
+
flex-shrink: 0 !important;
|
| 949 |
}
|
| 950 |
+
.ctrl-voice .gradio-radio fieldset > div > label > span {
|
| 951 |
color: #c4c4d4 !important;
|
| 952 |
+
font-size: 0.82rem !important;
|
| 953 |
font-weight: 500 !important;
|
| 954 |
text-transform: none !important;
|
| 955 |
letter-spacing: normal !important;
|
| 956 |
+
white-space: nowrap !important;
|
| 957 |
}
|
| 958 |
+
.ctrl-voice .gradio-radio fieldset > div > label:has(input:checked) > span {
|
| 959 |
color: #60a5fa !important;
|
| 960 |
}
|
| 961 |
+
.ctrl-voice .gradio-radio legend span {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 962 |
color: #9ca3af !important;
|
| 963 |
+
font-size: 0.75rem !important;
|
| 964 |
+
font-weight: 600 !important;
|
| 965 |
+
text-transform: uppercase !important;
|
| 966 |
+
letter-spacing: 0.06em !important;
|
| 967 |
}
|
| 968 |
|
| 969 |
+
/* Sliders */
|
| 970 |
+
.ctrl-steps .gradio-slider,
|
| 971 |
+
.ctrl-speed .gradio-slider { width: 100% !important; }
|
| 972 |
+
input[type=range] { accent-color: #60a5fa !important; }
|
| 973 |
+
|
| 974 |
/* Generate button */
|
| 975 |
.gen-btn {
|
| 976 |
background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
|
|
|
|
| 1015 |
table.examples td:last-child { border-right: 1px solid #1e1e2e !important; border-radius: 0 8px 8px 0 !important; }
|
| 1016 |
table.examples tr:hover td { background: #1a1a2e !important; border-color: #2a2a4e !important; color: #e8e8f0 !important; }
|
| 1017 |
|
| 1018 |
+
/* Dropdown base */
|
| 1019 |
.gradio-dropdown select, .gradio-dropdown input {
|
| 1020 |
+
background: #0d0d14 !important;
|
| 1021 |
+
border: 1px solid #2a2a3e !important;
|
| 1022 |
+
color: #e8e8f0 !important;
|
| 1023 |
+
border-radius: 8px !important;
|
| 1024 |
}
|
|
|
|
|
|
|
|
|
|
| 1025 |
|
| 1026 |
/* Responsive */
|
| 1027 |
@media (max-width: 640px) {
|
|
|
|
| 1047 |
value="The power to change begins the moment you believe it's possible!",
|
| 1048 |
)
|
| 1049 |
|
| 1050 |
+
with gr.Column(elem_classes="controls-row"):
|
| 1051 |
+
with gr.Row(elem_classes="ctrl-row1"):
|
| 1052 |
+
with gr.Column(elem_classes="ctrl-lang"):
|
| 1053 |
+
lang_input = gr.Dropdown(
|
| 1054 |
+
choices=[("English ๐บ๐ธ", "en"), ("Hebrew ๐ฎ๐ฑ", "he"), ("Spanish ๐ช๐ธ", "es"), ("German ๐ฉ๐ช", "de"), ("Italian ๐ฎ๐น", "it")],
|
| 1055 |
+
value="en", label="Language",
|
| 1056 |
+
)
|
| 1057 |
+
with gr.Column(elem_classes="ctrl-voice"):
|
| 1058 |
+
voice_input = gr.Radio(
|
| 1059 |
+
choices=list(VOICES.keys()), value="Female 1", label="Voice",
|
| 1060 |
+
)
|
| 1061 |
+
with gr.Row(elem_classes="ctrl-row2"):
|
| 1062 |
+
with gr.Column(elem_classes="ctrl-steps"):
|
| 1063 |
+
steps_input = gr.Slider(2, 16, 8, step=1, label="Quality (steps)")
|
| 1064 |
+
with gr.Column(elem_classes="ctrl-speed"):
|
| 1065 |
+
speed_input = gr.Slider(0.5, 2.0, 1.0, step=0.05, label="Speed")
|
| 1066 |
|
| 1067 |
btn = gr.Button("โก Generate Speech", elem_classes="gen-btn")
|
| 1068 |
|