Spaces:
Build error
Build error
Commit
Β·
311fb46
1
Parent(s):
d8bb1cb
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,23 @@ import gradio as gr
|
|
2 |
import requests
|
3 |
|
4 |
def generate_audio(text, voice_name):
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
MAX_CHARS = 100
|
7 |
-
|
8 |
-
|
|
|
9 |
text = text[:MAX_CHARS] # μ΅λ κΈμμλ‘ ν
μ€νΈ μλ₯΄κΈ°
|
10 |
|
11 |
voices = {
|
|
|
2 |
import requests
|
3 |
|
4 |
def generate_audio(text, voice_name):
|
5 |
+
|
6 |
+
# κ° μμ± μ΅μ
μ λν κΈ°λ³Έ ν
μ€νΈ μμ
|
7 |
+
default_examples = {
|
8 |
+
"λ¨μ±AI": "μλ
νμΈμ, λ¨μ± AI νμ€ μμ±μ
λλ€.",
|
9 |
+
"μ¬μ±AI": "μλ
νμΈμ, μ¬μ± AI νμ€ μμ±μ
λλ€.",
|
10 |
+
"νΈλΌν": "Make, America, Great, Again! , λ€μ, μλν, λ―Έκ΅μ, λ§λμλ€!",
|
11 |
+
"μ°¨μΉμ": "μλ
νμΈμ, μν΄ λ³΅ λ§μ΄ λ°μΌμκΈΈ κΈ°μν©λλ€.",
|
12 |
+
"κΉμ μ": "μλ
νμΈμ, μν΄ λ³΅ λ§μ΄ λ°μΌμκΈΈ κΈ°μν©λλ€.",
|
13 |
+
"λ
Έλ¬΄ν": "μλ
νμΈμ, μν΄ λ³΅ λ§μ΄ λ°μΌμκΈΈ κΈ°μν©λλ€.",
|
14 |
+
"κΆμ": "μλ
νμΈμ, λ―Έλ₯΅μ κ°λ₯΄μΉ¨μ, μ΄λ§λ λ°λ©νμ΄λλΌ.",
|
15 |
+
"μ€μμ΄": "μλ
νμΈμ, μν΄ λ³΅ λ§μ΄ λ°μΌμκΈΈ κΈ°μν©λλ€."
|
16 |
+
}
|
17 |
+
|
18 |
MAX_CHARS = 100
|
19 |
+
if not text:
|
20 |
+
text = default_examples[voice_name] # μ¬μ©μ μ
λ ₯μ΄ μμΌλ©΄ κΈ°λ³Έ μμ μ¬μ©
|
21 |
+
elif len(text) > MAX_CHARS:
|
22 |
text = text[:MAX_CHARS] # μ΅λ κΈμμλ‘ ν
μ€νΈ μλ₯΄κΈ°
|
23 |
|
24 |
voices = {
|