Spaces:
Runtime error
Runtime error
MZhao-LEGION
commited on
Commit
•
b8f004d
1
Parent(s):
2b47dda
chore: more adaptive layout; more character limit
Browse files- assets/audios/overlength_en.wav +0 -0
- assets/audios/overlength_ja.wav +0 -0
- css/style.css +5 -8
- presets.py +8 -5
assets/audios/overlength_en.wav
ADDED
Binary file (109 kB). View file
|
|
assets/audios/overlength_ja.wav
ADDED
Binary file (121 kB). View file
|
|
css/style.css
CHANGED
@@ -41,7 +41,7 @@
|
|
41 |
--gutter-width:24px;
|
42 |
|
43 |
--card-width: 42%;
|
44 |
-
--voice-flex: 0.
|
45 |
}
|
46 |
}
|
47 |
|
@@ -131,17 +131,17 @@ gradio-app {
|
|
131 |
align-content: center;
|
132 |
align-items: center;
|
133 |
}
|
134 |
-
#api_key_input {
|
135 |
flex-grow: 1;
|
136 |
}
|
137 |
#voice_list {
|
138 |
flex-grow: var(--voice-flex);
|
139 |
-
}
|
140 |
#api_key_input input {
|
141 |
margin: 0 !important;
|
142 |
padding: 6px 12px 6px 12px;
|
143 |
}
|
144 |
-
#api_key_input label span {
|
145 |
font-family: var(--font-heading) !important;
|
146 |
margin: 0;
|
147 |
width: 5rem;
|
@@ -155,7 +155,7 @@ gradio-app {
|
|
155 |
justify-content: center;
|
156 |
flex-direction: row;
|
157 |
}
|
158 |
-
#voice_list label span {
|
159 |
font-family: var(--font-heading) !important;
|
160 |
margin: 0;
|
161 |
width: 7rem;
|
@@ -167,9 +167,6 @@ gradio-app {
|
|
167 |
#voice_list .icon-wrap {
|
168 |
margin: 0 !important;
|
169 |
}
|
170 |
-
#voice_list ul {
|
171 |
-
width: 5rem !important;
|
172 |
-
}
|
173 |
|
174 |
/* Tabs */
|
175 |
.tabs {
|
|
|
41 |
--gutter-width:24px;
|
42 |
|
43 |
--card-width: 42%;
|
44 |
+
--voice-flex: 0.8;
|
45 |
}
|
46 |
}
|
47 |
|
|
|
131 |
align-content: center;
|
132 |
align-items: center;
|
133 |
}
|
134 |
+
/* #api_key_input {
|
135 |
flex-grow: 1;
|
136 |
}
|
137 |
#voice_list {
|
138 |
flex-grow: var(--voice-flex);
|
139 |
+
} */
|
140 |
#api_key_input input {
|
141 |
margin: 0 !important;
|
142 |
padding: 6px 12px 6px 12px;
|
143 |
}
|
144 |
+
#api_key_input label > span {
|
145 |
font-family: var(--font-heading) !important;
|
146 |
margin: 0;
|
147 |
width: 5rem;
|
|
|
155 |
justify-content: center;
|
156 |
flex-direction: row;
|
157 |
}
|
158 |
+
#voice_list label > span {
|
159 |
font-family: var(--font-heading) !important;
|
160 |
margin: 0;
|
161 |
width: 7rem;
|
|
|
167 |
#voice_list .icon-wrap {
|
168 |
margin: 0 !important;
|
169 |
}
|
|
|
|
|
|
|
170 |
|
171 |
/* Tabs */
|
172 |
.tabs {
|
presets.py
CHANGED
@@ -50,14 +50,17 @@ def speak_fn(
|
|
50 |
audio_list = []
|
51 |
while text.find("\n\n") != -1:
|
52 |
text = text.replace("\n\n", "\n")
|
53 |
-
if len(text) >
|
54 |
logging.info(f"Too Long Text: {text}")
|
55 |
-
if
|
56 |
-
text = "不要超过100字!"
|
57 |
-
audio_value = "./assets/audios/nomorethan100.wav"
|
58 |
-
else:
|
59 |
text = "这句太长了,憋坏我啦!"
|
60 |
audio_value = "./assets/audios/overlength.wav"
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
exceed_flag = not exceed_flag
|
62 |
else:
|
63 |
for idx, slice in enumerate(text.split("|")):
|
|
|
50 |
audio_list = []
|
51 |
while text.find("\n\n") != -1:
|
52 |
text = text.replace("\n\n", "\n")
|
53 |
+
if len(text) > 512:
|
54 |
logging.info(f"Too Long Text: {text}")
|
55 |
+
if speaker == "TalkFlower_CNzh":
|
|
|
|
|
|
|
56 |
text = "这句太长了,憋坏我啦!"
|
57 |
audio_value = "./assets/audios/overlength.wav"
|
58 |
+
elif speaker == "TalkFlower_USen":
|
59 |
+
text = "This sentence is too long!"
|
60 |
+
audio_value = "./assets/audios/overlength_en.wav"
|
61 |
+
elif speaker == "TalkFlower_JPja":
|
62 |
+
text = "この文は長すぎます!"
|
63 |
+
audio_value = "./assets/audios/overlength_ja.wav"
|
64 |
exceed_flag = not exceed_flag
|
65 |
else:
|
66 |
for idx, slice in enumerate(text.split("|")):
|