Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- __pycache__/webui.cpython-39.pyc +0 -0
- app.py +12 -6
- css/style.css +4 -0
- webui.py +0 -13
__pycache__/webui.cpython-39.pyc
CHANGED
Binary files a/__pycache__/webui.cpython-39.pyc and b/__pycache__/webui.cpython-39.pyc differ
|
|
app.py
CHANGED
@@ -47,7 +47,7 @@ def generate_audio(
|
|
47 |
audio_list.append(silence) # 将静音添加到列表中
|
48 |
return audio_list
|
49 |
|
50 |
-
def
|
51 |
text: str,
|
52 |
speaker="TalkFlower_CNzh",
|
53 |
sdp_ratio=0.2, # SDP/DP混合比
|
@@ -74,6 +74,9 @@ def speak(
|
|
74 |
return (hps.data.sampling_rate, audio_concat)
|
75 |
|
76 |
|
|
|
|
|
|
|
77 |
with open("./css/style.css", "r", encoding="utf-8") as f:
|
78 |
customCSS = f.read()
|
79 |
|
@@ -84,13 +87,18 @@ with gr.Blocks(css=customCSS) as demo:
|
|
84 |
speak_button = gr.Button("Speak!", elem_id="comfirm_button", elem_classes="button wonder-card")
|
85 |
audio_output = gr.Audio(label="输出音频", show_label=False, autoplay=True, elem_id="audio_output", elem_classes="wonder-card")
|
86 |
|
|
|
|
|
|
|
|
|
|
|
87 |
input_text.submit(
|
88 |
-
|
89 |
inputs=[input_text],
|
90 |
outputs=[audio_output]
|
91 |
)
|
92 |
speak_button.click(
|
93 |
-
|
94 |
inputs=[input_text],
|
95 |
outputs=[audio_output]
|
96 |
)
|
@@ -99,9 +107,7 @@ with gr.Blocks(css=customCSS) as demo:
|
|
99 |
if __name__ == "__main__":
|
100 |
hps = utils.get_hparams_from_file(config.webui_config.config_path)
|
101 |
version = hps.version if hasattr(hps, "version") else latest_version
|
102 |
-
net_g = get_net_g(
|
103 |
-
model_path=config.webui_config.model, version=version, device=device, hps=hps
|
104 |
-
)
|
105 |
reload_javascript()
|
106 |
demo.queue().launch(
|
107 |
allowed_paths=["./assets"],
|
|
|
47 |
audio_list.append(silence) # 将静音添加到列表中
|
48 |
return audio_list
|
49 |
|
50 |
+
def speak_fn(
|
51 |
text: str,
|
52 |
speaker="TalkFlower_CNzh",
|
53 |
sdp_ratio=0.2, # SDP/DP混合比
|
|
|
74 |
return (hps.data.sampling_rate, audio_concat)
|
75 |
|
76 |
|
77 |
+
def init_fn():
|
78 |
+
gr.Info("2023-11-23: Only support Chinese now. Trying to train a mutilingual model.")
|
79 |
+
|
80 |
with open("./css/style.css", "r", encoding="utf-8") as f:
|
81 |
customCSS = f.read()
|
82 |
|
|
|
87 |
speak_button = gr.Button("Speak!", elem_id="comfirm_button", elem_classes="button wonder-card")
|
88 |
audio_output = gr.Audio(label="输出音频", show_label=False, autoplay=True, elem_id="audio_output", elem_classes="wonder-card")
|
89 |
|
90 |
+
demo.load(
|
91 |
+
init_fn,
|
92 |
+
inputs=[],
|
93 |
+
outputs=[]
|
94 |
+
)
|
95 |
input_text.submit(
|
96 |
+
speak_fn,
|
97 |
inputs=[input_text],
|
98 |
outputs=[audio_output]
|
99 |
)
|
100 |
speak_button.click(
|
101 |
+
speak_fn,
|
102 |
inputs=[input_text],
|
103 |
outputs=[audio_output]
|
104 |
)
|
|
|
107 |
if __name__ == "__main__":
|
108 |
hps = utils.get_hparams_from_file(config.webui_config.config_path)
|
109 |
version = hps.version if hasattr(hps, "version") else latest_version
|
110 |
+
net_g = get_net_g(model_path=config.webui_config.model, version=version, device=device, hps=hps)
|
|
|
|
|
111 |
reload_javascript()
|
112 |
demo.queue().launch(
|
113 |
allowed_paths=["./assets"],
|
css/style.css
CHANGED
@@ -187,6 +187,10 @@ gradio-app {
|
|
187 |
color: var(--color-white)
|
188 |
} */
|
189 |
|
|
|
|
|
|
|
|
|
190 |
footer {
|
191 |
display: none !important;
|
192 |
}
|
|
|
187 |
color: var(--color-white)
|
188 |
} */
|
189 |
|
190 |
+
#watermark {
|
191 |
+
font-family: var(--font-heading) !important;
|
192 |
+
}
|
193 |
+
|
194 |
footer {
|
195 |
display: none !important;
|
196 |
}
|
webui.py
CHANGED
@@ -43,19 +43,6 @@ def reload_javascript():
|
|
43 |
}
|
44 |
</script>
|
45 |
"""
|
46 |
-
# meta = """
|
47 |
-
# <meta name="apple-mobile-web-app-title" content="川虎 Chat">
|
48 |
-
# <meta name="apple-mobile-web-app-capable" content="yes">
|
49 |
-
# <meta name="application-name" content="川虎 Chat">
|
50 |
-
# <meta name='viewport' content='width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover'>
|
51 |
-
# <meta name="theme-color" content="#ffffff">
|
52 |
-
|
53 |
-
# <link rel="apple-touch-icon-precomposed" href="/file=web_assets/icon/mask-icon-512.png" crossorigin="use-credentials">
|
54 |
-
# <link rel="apple-touch-icon" href="/file=web_assets/icon/mask-icon-512.png" crossorigin="use-credentials">
|
55 |
-
|
56 |
-
# <link rel="manifest" href="/file=web_assets/manifest.json" crossorigin="use-credentials">
|
57 |
-
# """
|
58 |
-
# css = css_html()
|
59 |
|
60 |
corner = """
|
61 |
<a href="https://www.bilibili.com/video/BV14M411Z7FR" class="bilibili-corner" aria-label="View author on Bilibili">
|
|
|
43 |
}
|
44 |
</script>
|
45 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
corner = """
|
48 |
<a href="https://www.bilibili.com/video/BV14M411Z7FR" class="bilibili-corner" aria-label="View author on Bilibili">
|