Spaces:
Runtime error
Runtime error
te-ch
commited on
Commit
·
c594ce9
1
Parent(s):
93a9849
add phonemiser selection to function
Browse files- Dockerfile +1 -1
- app.py +7 -2
Dockerfile
CHANGED
@@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y gnupg && \
|
|
7 |
apt-get update && \
|
8 |
apt-get -y install lame git make autoconf automake libtool pkg-config gcc libsonic-dev ronn kramdown libpcaudio-dev libatlas-base-dev gfortran
|
9 |
|
10 |
-
RUN git clone -b ca-
|
11 |
|
12 |
RUN cd espeak-ng && \
|
13 |
./autogen.sh && \
|
|
|
7 |
apt-get update && \
|
8 |
apt-get -y install lame git make autoconf automake libtool pkg-config gcc libsonic-dev ronn kramdown libpcaudio-dev libatlas-base-dev gfortran
|
9 |
|
10 |
+
RUN git clone -b ca-dev https://github.com/projecte-aina/espeak-ng
|
11 |
|
12 |
RUN cd espeak-ng && \
|
13 |
./autogen.sh && \
|
app.py
CHANGED
@@ -9,7 +9,10 @@ fonemitzador = Phonemizer("ca")
|
|
9 |
|
10 |
request_count = 0
|
11 |
|
12 |
-
def phonemiser(text,
|
|
|
|
|
|
|
13 |
if len(text) > MAX_TXT_LEN:
|
14 |
text = text[:MAX_TXT_LEN]
|
15 |
print(f"Input text was cutoff since it went over the {MAX_TXT_LEN} character limit.")
|
@@ -39,7 +42,9 @@ iface = gr.Interface(
|
|
39 |
label="Text",
|
40 |
value="L'Èlia i l'Alí a l'aula. L'oli i l'ou. Lulú olorava la lila.",
|
41 |
),
|
42 |
-
gr.Dropdown(label="
|
|
|
|
|
43 |
],
|
44 |
outputs=[
|
45 |
gr.Markdown(label="Fonemes")
|
|
|
9 |
|
10 |
request_count = 0
|
11 |
|
12 |
+
def phonemiser(text, dialect):
|
13 |
+
dialects = {"Central": "ca", "Valencian": "ca_va", "North-West": "ca_nw"}
|
14 |
+
dialect = dialects[dialect] #Define dialect from espeak-ng-data/lang/roa/ca
|
15 |
+
fonemitzador = Phonemizer(dialect) #Set correct dialect for the phonemiser
|
16 |
if len(text) > MAX_TXT_LEN:
|
17 |
text = text[:MAX_TXT_LEN]
|
18 |
print(f"Input text was cutoff since it went over the {MAX_TXT_LEN} character limit.")
|
|
|
42 |
label="Text",
|
43 |
value="L'Èlia i l'Alí a l'aula. L'oli i l'ou. Lulú olorava la lila.",
|
44 |
),
|
45 |
+
gr.Dropdown(label="Dialect", choices=["Central", "Valencian", "North-West"],
|
46 |
+
value="Central",
|
47 |
+
)
|
48 |
],
|
49 |
outputs=[
|
50 |
gr.Markdown(label="Fonemes")
|