Spaces:
Running on Zero
Running on Zero
Cheikh Niang commited on
Deploiement GuindiMa AI (interface Gradio)
Browse files- app.py +367 -63
- data/demo_audio/trajet liberte5_palais2.wav +0 -3
- data/demo_audio/trajet ouakam_palais.wav +0 -3
- data/trajets_frequents.json +35 -0
app.py
CHANGED
|
@@ -18,6 +18,7 @@ import atexit
|
|
| 18 |
import csv
|
| 19 |
import html
|
| 20 |
import itertools
|
|
|
|
| 21 |
import re
|
| 22 |
import os
|
| 23 |
import shutil
|
|
@@ -75,7 +76,6 @@ from tts.speak import ( # noqa: E402
|
|
| 75 |
)
|
| 76 |
|
| 77 |
VERT = "#00853F" # vert du Sénégal, celui du thème et des cartes
|
| 78 |
-
DEMO_AUDIO_DIR = RACINE / "data" / "demo_audio"
|
| 79 |
|
| 80 |
# --------------------------------------------------------------------------- #
|
| 81 |
# GPU
|
|
@@ -964,22 +964,27 @@ def _bandeau_autre_compagnie(compagnie: str, resultat: dict) -> str:
|
|
| 964 |
NOMS_COMPAGNIES = {"Tata AFTU": "Tata", "Dakar Dem Dikk": "Dem Dikk"}
|
| 965 |
|
| 966 |
|
| 967 |
-
def _bandeau_compagnie(
|
| 968 |
-
|
|
|
|
|
|
|
| 969 |
|
| 970 |
-
La voix l'emporte sur le bouton
|
| 971 |
-
|
| 972 |
-
|
| 973 |
-
|
|
|
|
| 974 |
"""
|
| 975 |
if compagnie_voix:
|
| 976 |
nom = NOMS_COMPAGNIES.get(compagnie_voix, compagnie_voix)
|
| 977 |
-
mention =
|
| 978 |
-
|
| 979 |
-
|
| 980 |
-
|
|
|
|
| 981 |
else:
|
| 982 |
-
|
|
|
|
| 983 |
return (
|
| 984 |
"<div style='color:#0B6B37;background:#EAF6EF;border:1px solid #C7E6D4;"
|
| 985 |
"border-radius:8px;padding:8px 12px;margin:10px 0;font-size:14px;"
|
|
@@ -1015,12 +1020,20 @@ def _code_erreur(intent: dict) -> str:
|
|
| 1015 |
return "extraction_locale" if intent.get("source") == "local" else "extraction_llm"
|
| 1016 |
|
| 1017 |
|
| 1018 |
-
def _pipeline(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1019 |
"""À partir d'une phrase transcrite : extraction, recherche, réponse.
|
| 1020 |
|
| 1021 |
C'est ce que trouver_le_bus faisait après la transcription, isolé pour pouvoir
|
| 1022 |
-
rejouer tout le traitement sur la seconde transcription.
|
| 1023 |
-
|
|
|
|
|
|
|
| 1024 |
"""
|
| 1025 |
quint = ("", "", _carte({}, "", ""), None, "")
|
| 1026 |
phrase = (phrase or "").strip()[:TEXTE_MAX]
|
|
@@ -1071,7 +1084,7 @@ def _pipeline(phrase: str, modele_asr: str, duree_asr: float, compagnie_choix: s
|
|
| 1071 |
resultat, exacte = MATCHER.find_line_compagnie(depart, arrivee, compagnie)
|
| 1072 |
if not exacte and (resultat["found"] or resultat.get("correspondances")):
|
| 1073 |
avertissement = _bandeau_autre_compagnie(compagnie, resultat)
|
| 1074 |
-
bandeau_compagnie = _bandeau_compagnie(compagnie_voix, compagnie_choix)
|
| 1075 |
trouve = bool(resultat["found"] or resultat.get("correspondances"))
|
| 1076 |
|
| 1077 |
nombre_lignes = len(resultat["lignes"]) + len(resultat.get("correspondances") or [])
|
|
@@ -1130,13 +1143,15 @@ def trouver_le_bus(audio: str | None, phrase_ecrite: str, compagnie_choix: str =
|
|
| 1130 |
)
|
| 1131 |
if not phrase:
|
| 1132 |
return vide
|
| 1133 |
-
quint, _ = _pipeline(
|
|
|
|
|
|
|
| 1134 |
return quint
|
| 1135 |
|
| 1136 |
phrase = (phrase_ecrite or "").strip()[:TEXTE_MAX]
|
| 1137 |
if not phrase:
|
| 1138 |
return vide
|
| 1139 |
-
quint, _ = _pipeline(phrase, "", 0.0, compagnie_choix)
|
| 1140 |
return quint
|
| 1141 |
|
| 1142 |
|
|
@@ -1145,9 +1160,81 @@ def _court(exc: Exception, longueur: int = 160) -> str:
|
|
| 1145 |
return f"{type(exc).__name__} : {exc}"[:longueur]
|
| 1146 |
|
| 1147 |
|
| 1148 |
-
|
| 1149 |
-
|
| 1150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1151 |
|
| 1152 |
|
| 1153 |
# Un même geste peut déclencher plusieurs événements Gradio : arrêter le micro
|
|
@@ -1157,14 +1244,23 @@ _DERNIERE_RECHERCHE: tuple | None = None
|
|
| 1157 |
_FENETRE_DOUBLON = 2.0
|
| 1158 |
|
| 1159 |
|
| 1160 |
-
def rechercher_une_fois(
|
| 1161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1162 |
|
| 1163 |
-
|
| 1164 |
-
|
| 1165 |
-
le
|
|
|
|
|
|
|
| 1166 |
"""
|
| 1167 |
global _DERNIERE_RECHERCHE
|
|
|
|
|
|
|
| 1168 |
cle = (audio, (phrase_ecrite or "").strip(), compagnie_choix or "")
|
| 1169 |
maintenant = time.monotonic()
|
| 1170 |
if (
|
|
@@ -1172,9 +1268,9 @@ def rechercher_une_fois(audio: str | None, phrase_ecrite: str, compagnie_choix:
|
|
| 1172 |
and _DERNIERE_RECHERCHE[0] == cle
|
| 1173 |
and maintenant - _DERNIERE_RECHERCHE[1] < _FENETRE_DOUBLON
|
| 1174 |
):
|
| 1175 |
-
return tuple(gr.skip() for _ in range(
|
| 1176 |
_DERNIERE_RECHERCHE = (cle, maintenant)
|
| 1177 |
-
return
|
| 1178 |
|
| 1179 |
|
| 1180 |
def _echauffer_llm():
|
|
@@ -1205,6 +1301,51 @@ if not MODE_TEST:
|
|
| 1205 |
# Interface
|
| 1206 |
# --------------------------------------------------------------------------- #
|
| 1207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1208 |
|
| 1209 |
def _theme():
|
| 1210 |
"""Thème vert Sénégal.
|
|
@@ -1221,10 +1362,136 @@ def _theme():
|
|
| 1221 |
return gr.themes.Soft(primary_hue="green")
|
| 1222 |
|
| 1223 |
|
| 1224 |
-
|
| 1225 |
-
|
| 1226 |
-
|
| 1227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1228 |
|
| 1229 |
|
| 1230 |
def _construire():
|
|
@@ -1235,9 +1502,8 @@ def _construire():
|
|
| 1235 |
"Parle ou écris ton trajet en wolof, à Dakar."
|
| 1236 |
)
|
| 1237 |
|
| 1238 |
-
# Les
|
| 1239 |
-
#
|
| 1240 |
-
# sous le bouton, avec .render().
|
| 1241 |
transcription_out = gr.Textbox(label="Transcription", interactive=False, render=False)
|
| 1242 |
trajet_out = gr.Textbox(label="Départ → arrivée", interactive=False, render=False)
|
| 1243 |
mention_out = gr.Markdown(render=False)
|
|
@@ -1246,36 +1512,33 @@ def _construire():
|
|
| 1246 |
sorties = [transcription_out, trajet_out, carte_out, audio_out, mention_out]
|
| 1247 |
|
| 1248 |
with gr.Tab("Parler"):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1249 |
audio_in = gr.Audio(
|
| 1250 |
sources=["microphone", "upload"],
|
| 1251 |
type="filepath",
|
| 1252 |
-
|
|
|
|
| 1253 |
)
|
| 1254 |
-
audios_demo = sorted(DEMO_AUDIO_DIR.glob("*.wav"))
|
| 1255 |
-
if audios_demo:
|
| 1256 |
-
# Pas de fn : choisir un exemple remplit audio_in, dont le change
|
| 1257 |
-
# déclenche la recherche automatique (avec la compagnie choisie).
|
| 1258 |
-
gr.Examples(
|
| 1259 |
-
examples=[[str(chemin)] for chemin in audios_demo],
|
| 1260 |
-
inputs=[audio_in],
|
| 1261 |
-
cache_examples=False,
|
| 1262 |
-
label="Ou alors, rejoue un enregistrement déjà prêt",
|
| 1263 |
-
)
|
| 1264 |
|
| 1265 |
with gr.Tab("Écrire"):
|
| 1266 |
texte_in = gr.Textbox(
|
|
|
|
| 1267 |
label="Ton trajet en wolof",
|
| 1268 |
-
placeholder=
|
| 1269 |
lines=2,
|
| 1270 |
max_length=TEXTE_MAX,
|
| 1271 |
)
|
| 1272 |
-
gr.
|
| 1273 |
-
|
| 1274 |
-
|
| 1275 |
-
|
| 1276 |
-
|
| 1277 |
-
|
| 1278 |
-
|
|
|
|
| 1279 |
)
|
| 1280 |
|
| 1281 |
compagnie_in = gr.Radio(
|
|
@@ -1301,20 +1564,60 @@ def _construire():
|
|
| 1301 |
"</div>"
|
| 1302 |
)
|
| 1303 |
|
| 1304 |
-
|
| 1305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1306 |
|
| 1307 |
# Recherche automatique, sans bouton : au relâchement du micro
|
| 1308 |
-
# (stop_recording), au dépôt d'un fichier et au
|
| 1309 |
-
#
|
| 1310 |
# rechercher_une_fois absorbe l'événement en double que produit un même
|
| 1311 |
-
# geste
|
| 1312 |
for evenement in (audio_in.stop_recording, audio_in.change):
|
| 1313 |
evenement(
|
| 1314 |
rechercher_une_fois,
|
| 1315 |
-
inputs=[audio_in, texte_in, compagnie_in],
|
| 1316 |
-
outputs=
|
| 1317 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1318 |
return interface
|
| 1319 |
|
| 1320 |
|
|
@@ -1325,5 +1628,6 @@ if __name__ == "__main__":
|
|
| 1325 |
# queue() est obligatoire pour ZeroGPU : la réservation du GPU ne fonctionne que
|
| 1326 |
# si les exécutions passent par la file. Sur un Space, Gradio règle tout seul
|
| 1327 |
# l'hôte et le port à lancer.
|
| 1328 |
-
# Depuis Gradio 6, le thème se
|
| 1329 |
-
|
|
|
|
|
|
| 18 |
import csv
|
| 19 |
import html
|
| 20 |
import itertools
|
| 21 |
+
import json
|
| 22 |
import re
|
| 23 |
import os
|
| 24 |
import shutil
|
|
|
|
| 76 |
)
|
| 77 |
|
| 78 |
VERT = "#00853F" # vert du Sénégal, celui du thème et des cartes
|
|
|
|
| 79 |
|
| 80 |
# --------------------------------------------------------------------------- #
|
| 81 |
# GPU
|
|
|
|
| 964 |
NOMS_COMPAGNIES = {"Tata AFTU": "Tata", "Dakar Dem Dikk": "Dem Dikk"}
|
| 965 |
|
| 966 |
|
| 967 |
+
def _bandeau_compagnie(
|
| 968 |
+
compagnie_voix: str, compagnie_bouton: str, mode: str = "texte"
|
| 969 |
+
) -> str:
|
| 970 |
+
"""Rappelle la compagnie réellement utilisée, au-dessus des cartes.
|
| 971 |
|
| 972 |
+
La compagnie dite à la voix l'emporte sur le bouton. En mode texte, une
|
| 973 |
+
compagnie explicitement écrite dans la phrase l'emporte aussi (comportement
|
| 974 |
+
historique des phrases « ... ak Tata »). Sinon on affiche le bouton tel
|
| 975 |
+
qu'il est au moment de la recherche, y compris « Tous » : après un passage
|
| 976 |
+
de Tata à Dem Dikk, l'étiquette ne doit jamais rester sur l'ancien choix.
|
| 977 |
"""
|
| 978 |
if compagnie_voix:
|
| 979 |
nom = NOMS_COMPAGNIES.get(compagnie_voix, compagnie_voix)
|
| 980 |
+
mention = (
|
| 981 |
+
"dite à la voix, prioritaire sur le bouton"
|
| 982 |
+
if mode == "voix"
|
| 983 |
+
else "indiquée dans ton texte"
|
| 984 |
+
)
|
| 985 |
else:
|
| 986 |
+
nom = NOMS_COMPAGNIES.get(compagnie_bouton, compagnie_bouton) or "Tous"
|
| 987 |
+
mention = "choisie avec le bouton"
|
| 988 |
return (
|
| 989 |
"<div style='color:#0B6B37;background:#EAF6EF;border:1px solid #C7E6D4;"
|
| 990 |
"border-radius:8px;padding:8px 12px;margin:10px 0;font-size:14px;"
|
|
|
|
| 1020 |
return "extraction_locale" if intent.get("source") == "local" else "extraction_llm"
|
| 1021 |
|
| 1022 |
|
| 1023 |
+
def _pipeline(
|
| 1024 |
+
phrase: str,
|
| 1025 |
+
modele_asr: str,
|
| 1026 |
+
duree_asr: float,
|
| 1027 |
+
compagnie_choix: str = "",
|
| 1028 |
+
mode: str = "texte",
|
| 1029 |
+
) -> tuple:
|
| 1030 |
"""À partir d'une phrase transcrite : extraction, recherche, réponse.
|
| 1031 |
|
| 1032 |
C'est ce que trouver_le_bus faisait après la transcription, isolé pour pouvoir
|
| 1033 |
+
rejouer tout le traitement sur la seconde transcription. `mode` distingue une
|
| 1034 |
+
demande tapée d'une demande vocale : il ne change pas la recherche, seulement
|
| 1035 |
+
la façon dont le bandeau explique d'où vient la compagnie. Renvoie le
|
| 1036 |
+
quintuplet des sorties, suivi d'un booléen : un trajet a-t-il été trouvé ?
|
| 1037 |
"""
|
| 1038 |
quint = ("", "", _carte({}, "", ""), None, "")
|
| 1039 |
phrase = (phrase or "").strip()[:TEXTE_MAX]
|
|
|
|
| 1084 |
resultat, exacte = MATCHER.find_line_compagnie(depart, arrivee, compagnie)
|
| 1085 |
if not exacte and (resultat["found"] or resultat.get("correspondances")):
|
| 1086 |
avertissement = _bandeau_autre_compagnie(compagnie, resultat)
|
| 1087 |
+
bandeau_compagnie = _bandeau_compagnie(compagnie_voix, compagnie_choix, mode=mode)
|
| 1088 |
trouve = bool(resultat["found"] or resultat.get("correspondances"))
|
| 1089 |
|
| 1090 |
nombre_lignes = len(resultat["lignes"]) + len(resultat.get("correspondances") or [])
|
|
|
|
| 1143 |
)
|
| 1144 |
if not phrase:
|
| 1145 |
return vide
|
| 1146 |
+
quint, _ = _pipeline(
|
| 1147 |
+
phrase, modele_asr, duree_asr, compagnie_choix, mode="voix"
|
| 1148 |
+
)
|
| 1149 |
return quint
|
| 1150 |
|
| 1151 |
phrase = (phrase_ecrite or "").strip()[:TEXTE_MAX]
|
| 1152 |
if not phrase:
|
| 1153 |
return vide
|
| 1154 |
+
quint, _ = _pipeline(phrase, "", 0.0, compagnie_choix, mode="texte")
|
| 1155 |
return quint
|
| 1156 |
|
| 1157 |
|
|
|
|
| 1160 |
return f"{type(exc).__name__} : {exc}"[:longueur]
|
| 1161 |
|
| 1162 |
|
| 1163 |
+
MESSAGE_DEMANDE_VIDE = "Écris ton trajet ou choisis un trajet fréquent"
|
| 1164 |
+
|
| 1165 |
+
|
| 1166 |
+
def _sortie_demande_vide() -> tuple:
|
| 1167 |
+
"""Le quintuplet affiché quand ni le micro ni le texte ne portent une demande."""
|
| 1168 |
+
carte = "### ✍️ À toi de jouer\n\n" + MESSAGE_DEMANDE_VIDE
|
| 1169 |
+
return ("", "", carte, None, "")
|
| 1170 |
+
|
| 1171 |
+
|
| 1172 |
+
def traiter_demande(
|
| 1173 |
+
audio: str | None,
|
| 1174 |
+
phrase_ecrite: str,
|
| 1175 |
+
compagnie_choix: str = "",
|
| 1176 |
+
etat: dict | None = None,
|
| 1177 |
+
nouvelle_demande: bool = True,
|
| 1178 |
+
) -> tuple:
|
| 1179 |
+
"""Le seul handler du bouton, du micro et du changement de compagnie.
|
| 1180 |
+
|
| 1181 |
+
Les sept sorties sont : les cinq résultats, le micro d'entrée et l'état de la
|
| 1182 |
+
dernière demande. Une nouvelle demande vient du micro (mode « voix ») ou du
|
| 1183 |
+
texte (mode « texte »). Un changement de compagnie relit cet état sans
|
| 1184 |
+
retranscrire l'audio : la phrase et son mode suffisent, et le bouton courant
|
| 1185 |
+
est utilisé pour la recherche et le bandeau.
|
| 1186 |
+
"""
|
| 1187 |
+
compagnie_choix = compagnie_choix or ""
|
| 1188 |
+
|
| 1189 |
+
if not nouvelle_demande:
|
| 1190 |
+
if not isinstance(etat, dict):
|
| 1191 |
+
return tuple(gr.skip() for _ in range(7))
|
| 1192 |
+
phrase = (etat.get("phrase") or "").strip()
|
| 1193 |
+
if not phrase:
|
| 1194 |
+
return tuple(gr.skip() for _ in range(7))
|
| 1195 |
+
mode = etat.get("mode") or "texte"
|
| 1196 |
+
quint, _ = _pipeline(phrase, "", 0.0, compagnie_choix, mode=mode)
|
| 1197 |
+
# Le micro et la demande restent tels quels : on ne retranscrit rien.
|
| 1198 |
+
return (*quint, gr.skip(), etat)
|
| 1199 |
+
|
| 1200 |
+
if audio:
|
| 1201 |
+
quint = trouver_le_bus(audio, phrase_ecrite, compagnie_choix)
|
| 1202 |
+
if not quint[0]:
|
| 1203 |
+
return (*quint, None, None)
|
| 1204 |
+
return (*quint, None, {"phrase": quint[0], "mode": "voix"})
|
| 1205 |
+
|
| 1206 |
+
phrase = (phrase_ecrite or "").strip()[:TEXTE_MAX]
|
| 1207 |
+
if not phrase:
|
| 1208 |
+
return (*_sortie_demande_vide(), None, None)
|
| 1209 |
+
quint = trouver_le_bus(None, phrase, compagnie_choix)
|
| 1210 |
+
return (*quint, None, {"phrase": phrase, "mode": "texte"})
|
| 1211 |
+
|
| 1212 |
+
|
| 1213 |
+
def repondre_et_vider_micro(
|
| 1214 |
+
audio: str | None, phrase_ecrite: str, compagnie_choix: str = ""
|
| 1215 |
+
) -> tuple:
|
| 1216 |
+
"""Version à six sorties conservée pour l'API et les anciens tests.
|
| 1217 |
+
|
| 1218 |
+
L'interface utilise `traiter_demande`, qui ajoute l'état nécessaire au
|
| 1219 |
+
changement de compagnie. Le sixième retour remet le micro à None pour
|
| 1220 |
+
l'enregistrement suivant, sans toucher aux cartes ni à la voix.
|
| 1221 |
+
"""
|
| 1222 |
+
return traiter_demande(audio, phrase_ecrite, compagnie_choix, None, True)[:6]
|
| 1223 |
+
|
| 1224 |
+
|
| 1225 |
+
def choisir_trajet_frequent(choix: str | None, compagnie_choix: str = "") -> tuple:
|
| 1226 |
+
"""Remplir la phrase wolof, lancer la recherche, puis vider la liste.
|
| 1227 |
+
|
| 1228 |
+
Les neuf sorties sont : la phrase, les sept résultats (dont l'état) et la
|
| 1229 |
+
liste remise à None. Vider la liste émet un change ; il est ignoré par le
|
| 1230 |
+
garde du début, donc aucun second calcul.
|
| 1231 |
+
"""
|
| 1232 |
+
if not isinstance(choix, str) or choix not in CHOIX_TRAJETS_FREQUENTS:
|
| 1233 |
+
return tuple(gr.skip() for _ in range(9))
|
| 1234 |
+
trajet = CHOIX_TRAJETS_FREQUENTS[choix]
|
| 1235 |
+
phrase = f"Maa ngi {trajet['depart']}, bëgg naa dem {trajet['arrivee']}"
|
| 1236 |
+
resultat = traiter_demande(None, phrase, compagnie_choix, None, True)
|
| 1237 |
+
return (phrase, *resultat, None)
|
| 1238 |
|
| 1239 |
|
| 1240 |
# Un même geste peut déclencher plusieurs événements Gradio : arrêter le micro
|
|
|
|
| 1244 |
_FENETRE_DOUBLON = 2.0
|
| 1245 |
|
| 1246 |
|
| 1247 |
+
def rechercher_une_fois(
|
| 1248 |
+
audio: str | None,
|
| 1249 |
+
phrase_ecrite: str,
|
| 1250 |
+
compagnie_choix: str = "",
|
| 1251 |
+
etat: dict | None = None,
|
| 1252 |
+
) -> tuple:
|
| 1253 |
+
"""Lancer une demande une seule fois par audio, jamais sur un micro vidé.
|
| 1254 |
|
| 1255 |
+
Le vidage automatique remet le composant à None et émet un change : sans ce
|
| 1256 |
+
garde, la phrase encore dans la zone texte relancerait une recherche et
|
| 1257 |
+
effacerait le résultat qu'on vient d'afficher. Un micro vide est donc ignoré
|
| 1258 |
+
silencieusement. Les doublons d'un même geste renvoient gr.skip() pour garder
|
| 1259 |
+
les cartes déjà calculées.
|
| 1260 |
"""
|
| 1261 |
global _DERNIERE_RECHERCHE
|
| 1262 |
+
if not audio:
|
| 1263 |
+
return tuple(gr.skip() for _ in range(7))
|
| 1264 |
cle = (audio, (phrase_ecrite or "").strip(), compagnie_choix or "")
|
| 1265 |
maintenant = time.monotonic()
|
| 1266 |
if (
|
|
|
|
| 1268 |
and _DERNIERE_RECHERCHE[0] == cle
|
| 1269 |
and maintenant - _DERNIERE_RECHERCHE[1] < _FENETRE_DOUBLON
|
| 1270 |
):
|
| 1271 |
+
return tuple(gr.skip() for _ in range(7))
|
| 1272 |
_DERNIERE_RECHERCHE = (cle, maintenant)
|
| 1273 |
+
return traiter_demande(audio, phrase_ecrite, compagnie_choix, etat, True)
|
| 1274 |
|
| 1275 |
|
| 1276 |
def _echauffer_llm():
|
|
|
|
| 1301 |
# Interface
|
| 1302 |
# --------------------------------------------------------------------------- #
|
| 1303 |
|
| 1304 |
+
TRAJETS_FREQUENTS_FICHIER = RACINE / "data" / "trajets_frequents.json"
|
| 1305 |
+
MICRO_ELEM_ID = "micro_guindima"
|
| 1306 |
+
|
| 1307 |
+
|
| 1308 |
+
def _charger_trajets_frequents(
|
| 1309 |
+
chemin: Path = TRAJETS_FREQUENTS_FICHIER,
|
| 1310 |
+
) -> list[dict[str, str]]:
|
| 1311 |
+
"""Charge et valide la liste proposée dans l'onglet « Écrire ».
|
| 1312 |
+
|
| 1313 |
+
Le fichier est petit et lu une seule fois au démarrage. On refuse les clés
|
| 1314 |
+
inconnues et les doublons : une faute de frappe doit se voir au lancement,
|
| 1315 |
+
pas se traduire par un choix qui ne fait rien sur le téléphone.
|
| 1316 |
+
"""
|
| 1317 |
+
with open(chemin, encoding="utf-8") as fichier:
|
| 1318 |
+
donnees = json.load(fichier)
|
| 1319 |
+
if not isinstance(donnees, list):
|
| 1320 |
+
raise ValueError("data/trajets_frequents.json doit contenir une liste")
|
| 1321 |
+
|
| 1322 |
+
trajets: list[dict[str, str]] = []
|
| 1323 |
+
deja_vus: set[tuple[str, str]] = set()
|
| 1324 |
+
for entree in donnees:
|
| 1325 |
+
if not isinstance(entree, dict) or set(entree) != {"depart", "arrivee"}:
|
| 1326 |
+
raise ValueError(f"trajet fréquent invalide : {entree!r}")
|
| 1327 |
+
depart = str(entree["depart"]).strip()
|
| 1328 |
+
arrivee = str(entree["arrivee"]).strip()
|
| 1329 |
+
if not depart or not arrivee:
|
| 1330 |
+
raise ValueError(f"trajet fréquent vide : {entree!r}")
|
| 1331 |
+
cle = (depart, arrivee)
|
| 1332 |
+
if cle in deja_vus:
|
| 1333 |
+
raise ValueError(f"trajet fréquent en double : {depart} → {arrivee}")
|
| 1334 |
+
deja_vus.add(cle)
|
| 1335 |
+
trajets.append({"depart": depart, "arrivee": arrivee})
|
| 1336 |
+
print(f"[trajets fréquents] {len(trajets)} trajets chargés", flush=True)
|
| 1337 |
+
return trajets
|
| 1338 |
+
|
| 1339 |
+
|
| 1340 |
+
def _libelle_trajet_frequent(trajet: dict[str, str]) -> str:
|
| 1341 |
+
return f"{trajet['depart']} → {trajet['arrivee']}"
|
| 1342 |
+
|
| 1343 |
+
|
| 1344 |
+
TRAJETS_FREQUENTS = _charger_trajets_frequents()
|
| 1345 |
+
CHOIX_TRAJETS_FREQUENTS = {
|
| 1346 |
+
_libelle_trajet_frequent(trajet): trajet for trajet in TRAJETS_FREQUENTS
|
| 1347 |
+
}
|
| 1348 |
+
|
| 1349 |
|
| 1350 |
def _theme():
|
| 1351 |
"""Thème vert Sénégal.
|
|
|
|
| 1362 |
return gr.themes.Soft(primary_hue="green")
|
| 1363 |
|
| 1364 |
|
| 1365 |
+
# Les classes .record-button, .stop-button et .mic-select viennent du frontend
|
| 1366 |
+
# Gradio 6.30.0 installé (assets/audio-*.css), pas d'une supposition : les
|
| 1367 |
+
# boutons du micro changent de nom entre les versions. Tout est limité à
|
| 1368 |
+
# #micro_guindima pour ne pas toucher les autres composants Audio.
|
| 1369 |
+
CSS_GUINDIMA = r"""
|
| 1370 |
+
#consigne_micro {
|
| 1371 |
+
background: #E8F5EE;
|
| 1372 |
+
border: 1px solid #C7E6D4;
|
| 1373 |
+
border-left: 5px solid #00853F;
|
| 1374 |
+
border-right: 5px solid #00853F;
|
| 1375 |
+
border-radius: 10px;
|
| 1376 |
+
color: #064E2B;
|
| 1377 |
+
font-size: 18px;
|
| 1378 |
+
font-weight: 700;
|
| 1379 |
+
line-height: 1.35;
|
| 1380 |
+
margin: 0 0 10px 0;
|
| 1381 |
+
padding: 12px 14px;
|
| 1382 |
+
}
|
| 1383 |
+
#consigne_micro p { margin: 0; }
|
| 1384 |
+
|
| 1385 |
+
#micro_guindima .mic-wrap,
|
| 1386 |
+
#micro_guindima .controls,
|
| 1387 |
+
#micro_guindima .wrapper {
|
| 1388 |
+
width: 100%;
|
| 1389 |
+
}
|
| 1390 |
+
#micro_guindima .mic-wrap { margin: 0; }
|
| 1391 |
+
#micro_guindima .controls { justify-content: center; }
|
| 1392 |
+
#micro_guindima .wrapper { justify-content: center; }
|
| 1393 |
+
|
| 1394 |
+
#micro_guindima .record-button,
|
| 1395 |
+
#micro_guindima .stop-button {
|
| 1396 |
+
align-items: center;
|
| 1397 |
+
border: 0 !important;
|
| 1398 |
+
border-radius: 14px;
|
| 1399 |
+
box-sizing: border-box;
|
| 1400 |
+
color: #FFFFFF;
|
| 1401 |
+
cursor: pointer;
|
| 1402 |
+
display: flex;
|
| 1403 |
+
font-size: 20px;
|
| 1404 |
+
font-weight: 800;
|
| 1405 |
+
justify-content: center;
|
| 1406 |
+
line-height: 1.1;
|
| 1407 |
+
min-height: 64px;
|
| 1408 |
+
padding: 0 20px;
|
| 1409 |
+
touch-action: manipulation;
|
| 1410 |
+
}
|
| 1411 |
+
#micro_guindima .record-button {
|
| 1412 |
+
background: #00853F;
|
| 1413 |
+
box-shadow: 0 4px 14px rgba(0, 133, 63, 0.35);
|
| 1414 |
+
flex: 1 1 100%;
|
| 1415 |
+
width: 100%;
|
| 1416 |
+
}
|
| 1417 |
+
#micro_guindima .record-button::before {
|
| 1418 |
+
background: none;
|
| 1419 |
+
border-radius: 0;
|
| 1420 |
+
content: "🎙️";
|
| 1421 |
+
height: auto;
|
| 1422 |
+
margin: 0 10px 0 0;
|
| 1423 |
+
width: auto;
|
| 1424 |
+
}
|
| 1425 |
+
#micro_guindima .record-button:active { transform: translateY(1px); }
|
| 1426 |
+
#micro_guindima .record-icon { display: none !important; }
|
| 1427 |
+
|
| 1428 |
+
#micro_guindima .stop-button {
|
| 1429 |
+
background: #D62828;
|
| 1430 |
+
animation: guindima-pulse 1.2s ease-in-out infinite;
|
| 1431 |
+
align-self: center;
|
| 1432 |
+
flex: 0 0 25%;
|
| 1433 |
+
margin: 0 auto !important;
|
| 1434 |
+
min-width: 120px;
|
| 1435 |
+
width: 25%;
|
| 1436 |
+
}
|
| 1437 |
+
#micro_guindima .stop-button::before {
|
| 1438 |
+
background: none;
|
| 1439 |
+
border-radius: 0;
|
| 1440 |
+
content: "⏹️";
|
| 1441 |
+
height: auto;
|
| 1442 |
+
margin: 0 10px 0 0;
|
| 1443 |
+
width: auto;
|
| 1444 |
+
}
|
| 1445 |
+
#micro_guindima .stop-button-paused { background: #D62828; color: #FFFFFF; }
|
| 1446 |
+
|
| 1447 |
+
#micro_guindima .mic-select { display: none !important; }
|
| 1448 |
+
|
| 1449 |
+
/* La croix du composant Audio efface l'enregistrement avant qu'il soit traité.
|
| 1450 |
+
Le DOM Gradio 6.30.0 la rend en <button class="icon-button" aria-label="Effacer">. */
|
| 1451 |
+
#micro_guindima .icon-button-wrapper.top-panel button[aria-label="Effacer"],
|
| 1452 |
+
#micro_guindima .icon-button-wrapper.top-panel button[aria-label="Clear"] {
|
| 1453 |
+
display: none !important;
|
| 1454 |
+
}
|
| 1455 |
+
|
| 1456 |
+
/* Toute la ligne d'une option est cliquable. Les options sont parfois portées
|
| 1457 |
+
hors de #trajets_frequents (position:fixed) : on cible aussi .options, sachant
|
| 1458 |
+
qu'il n'y a qu'un seul Dropdown dans cette interface. */
|
| 1459 |
+
#trajets_frequents .item,
|
| 1460 |
+
.options .item {
|
| 1461 |
+
align-items: center;
|
| 1462 |
+
box-sizing: border-box;
|
| 1463 |
+
cursor: pointer;
|
| 1464 |
+
display: flex;
|
| 1465 |
+
justify-content: flex-start;
|
| 1466 |
+
min-height: 44px;
|
| 1467 |
+
padding: 10px 12px;
|
| 1468 |
+
width: 100%;
|
| 1469 |
+
}
|
| 1470 |
+
#trajets_frequents .item:hover,
|
| 1471 |
+
.options .item:hover,
|
| 1472 |
+
#trajets_frequents .item.selected,
|
| 1473 |
+
.options .item.selected {
|
| 1474 |
+
background: #E8F5EE;
|
| 1475 |
+
color: #064E2B;
|
| 1476 |
+
}
|
| 1477 |
+
|
| 1478 |
+
@keyframes guindima-pulse {
|
| 1479 |
+
0%, 100% { box-shadow: 0 4px 14px rgba(214, 40, 40, 0.35); }
|
| 1480 |
+
50% { box-shadow: 0 4px 24px rgba(214, 40, 40, 0.75); }
|
| 1481 |
+
}
|
| 1482 |
+
@media (prefers-reduced-motion: reduce) {
|
| 1483 |
+
#micro_guindima .stop-button { animation: none; }
|
| 1484 |
+
}
|
| 1485 |
+
"""
|
| 1486 |
+
|
| 1487 |
+
I18N_GUINDIMA = (
|
| 1488 |
+
gr.I18n(
|
| 1489 |
+
fr={"audio.record": "Appuie et parle", "audio.stop": "Arrête"},
|
| 1490 |
+
en={"audio.record": "Appuie et parle", "audio.stop": "Arrête"},
|
| 1491 |
+
)
|
| 1492 |
+
if gr is not None
|
| 1493 |
+
else None
|
| 1494 |
+
)
|
| 1495 |
|
| 1496 |
|
| 1497 |
def _construire():
|
|
|
|
| 1502 |
"Parle ou écris ton trajet en wolof, à Dakar."
|
| 1503 |
)
|
| 1504 |
|
| 1505 |
+
# Les sorties sont créées hors écran : elles servent au bouton, au micro
|
| 1506 |
+
# et à la liste de trajets avant d'être affichées plus bas.
|
|
|
|
| 1507 |
transcription_out = gr.Textbox(label="Transcription", interactive=False, render=False)
|
| 1508 |
trajet_out = gr.Textbox(label="Départ → arrivée", interactive=False, render=False)
|
| 1509 |
mention_out = gr.Markdown(render=False)
|
|
|
|
| 1512 |
sorties = [transcription_out, trajet_out, carte_out, audio_out, mention_out]
|
| 1513 |
|
| 1514 |
with gr.Tab("Parler"):
|
| 1515 |
+
gr.Markdown(
|
| 1516 |
+
"**Appuie sur le bouton vert, dis ton trajet, puis appuie sur Arrête**",
|
| 1517 |
+
elem_id="consigne_micro",
|
| 1518 |
+
)
|
| 1519 |
audio_in = gr.Audio(
|
| 1520 |
sources=["microphone", "upload"],
|
| 1521 |
type="filepath",
|
| 1522 |
+
show_label=False,
|
| 1523 |
+
elem_id=MICRO_ELEM_ID,
|
| 1524 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1525 |
|
| 1526 |
with gr.Tab("Écrire"):
|
| 1527 |
texte_in = gr.Textbox(
|
| 1528 |
+
value="",
|
| 1529 |
label="Ton trajet en wolof",
|
| 1530 |
+
placeholder="Ex. : Maa ngi Parcelles Assainies, bëgg naa dem UCAD",
|
| 1531 |
lines=2,
|
| 1532 |
max_length=TEXTE_MAX,
|
| 1533 |
)
|
| 1534 |
+
trajets_in = gr.Dropdown(
|
| 1535 |
+
choices=list(CHOIX_TRAJETS_FREQUENTS),
|
| 1536 |
+
value=None,
|
| 1537 |
+
label="🚌 Trajets fréquents à Dakar",
|
| 1538 |
+
info="Tape le nom d'un quartier, par ex. Malika",
|
| 1539 |
+
filterable=True,
|
| 1540 |
+
allow_custom_value=False,
|
| 1541 |
+
elem_id="trajets_frequents",
|
| 1542 |
)
|
| 1543 |
|
| 1544 |
compagnie_in = gr.Radio(
|
|
|
|
| 1564 |
"</div>"
|
| 1565 |
)
|
| 1566 |
|
| 1567 |
+
sorties_avec_micro = [*sorties, audio_in]
|
| 1568 |
+
demande_state = gr.State(None)
|
| 1569 |
+
nouvelle_demande = gr.State(True)
|
| 1570 |
+
relancer_compagnie = gr.State(False)
|
| 1571 |
+
|
| 1572 |
+
# Point d'entrée API conservé : les scripts et les tests en ligne
|
| 1573 |
+
# appellent encore `repondre_et_vider_micro` avec trois champs. Il ne
|
| 1574 |
+
# conserve pas d'état, contrairement à l'interface.
|
| 1575 |
+
api_bouton = gr.Button("API", visible=False, elem_id="api_repondre")
|
| 1576 |
+
api_bouton.click(
|
| 1577 |
+
repondre_et_vider_micro,
|
| 1578 |
+
inputs=[audio_in, texte_in, compagnie_in],
|
| 1579 |
+
outputs=sorties_avec_micro,
|
| 1580 |
+
)
|
| 1581 |
+
|
| 1582 |
+
# Le bouton et la compagnie passent par le même handler. Le booléen
|
| 1583 |
+
# distingue une nouvelle demande (bouton/micro) d'un simple changement de
|
| 1584 |
+
# compagnie, qui relit l'état sans retranscrire l'audio.
|
| 1585 |
+
bouton.click(
|
| 1586 |
+
traiter_demande,
|
| 1587 |
+
inputs=[audio_in, texte_in, compagnie_in, demande_state, nouvelle_demande],
|
| 1588 |
+
outputs=[*sorties_avec_micro, demande_state],
|
| 1589 |
+
)
|
| 1590 |
+
|
| 1591 |
+
# Un trajet fréquent remplit le texte, lance la recherche avec la
|
| 1592 |
+
# compagnie choisie, vide le micro puis remet la liste à vide. Le change
|
| 1593 |
+
# provoqué par ce dernier None est ignoré : pas de seconde recherche.
|
| 1594 |
+
trajets_in.change(
|
| 1595 |
+
choisir_trajet_frequent,
|
| 1596 |
+
inputs=[trajets_in, compagnie_in],
|
| 1597 |
+
outputs=[texte_in, *sorties_avec_micro, demande_state, trajets_in],
|
| 1598 |
+
)
|
| 1599 |
|
| 1600 |
# Recherche automatique, sans bouton : au relâchement du micro
|
| 1601 |
+
# (stop_recording), au dépôt d'un fichier (change) et au vidage du micro.
|
| 1602 |
+
# La compagnie choisie est passée comme au clic du bouton ;
|
| 1603 |
# rechercher_une_fois absorbe l'événement en double que produit un même
|
| 1604 |
+
# geste et ignore le change dû au vidage.
|
| 1605 |
for evenement in (audio_in.stop_recording, audio_in.change):
|
| 1606 |
evenement(
|
| 1607 |
rechercher_une_fois,
|
| 1608 |
+
inputs=[audio_in, texte_in, compagnie_in, demande_state],
|
| 1609 |
+
outputs=[*sorties_avec_micro, demande_state],
|
| 1610 |
)
|
| 1611 |
+
|
| 1612 |
+
# Changer Tata/Dem Dikk/Tous rejoue la dernière demande avec la nouvelle
|
| 1613 |
+
# valeur. On lit le bouton dans l'événement, jamais dans une copie gardée
|
| 1614 |
+
# en mémoire : l'étiquette et les lignes suivent donc toujours le choix
|
| 1615 |
+
# affiché.
|
| 1616 |
+
compagnie_in.change(
|
| 1617 |
+
traiter_demande,
|
| 1618 |
+
inputs=[audio_in, texte_in, compagnie_in, demande_state, relancer_compagnie],
|
| 1619 |
+
outputs=[*sorties_avec_micro, demande_state],
|
| 1620 |
+
)
|
| 1621 |
return interface
|
| 1622 |
|
| 1623 |
|
|
|
|
| 1628 |
# queue() est obligatoire pour ZeroGPU : la réservation du GPU ne fonctionne que
|
| 1629 |
# si les exécutions passent par la file. Sur un Space, Gradio règle tout seul
|
| 1630 |
# l'hôte et le port à lancer.
|
| 1631 |
+
# Depuis Gradio 6, le thème et le CSS se passent au lancement, plus au
|
| 1632 |
+
# constructeur. i18n remplace les libellés anglais du micro.
|
| 1633 |
+
demo.queue().launch(theme=_theme(), css=CSS_GUINDIMA, i18n=I18N_GUINDIMA)
|
data/demo_audio/trajet liberte5_palais2.wav
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:0634f52efdf1729beb71bfc90d69b63f72c8143640d0ff82117003fe608b514f
|
| 3 |
-
size 207404
|
|
|
|
|
|
|
|
|
|
|
|
data/demo_audio/trajet ouakam_palais.wav
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f11927f80cba52f68fce94fb6aaf41b77f007b16693eafb2c01f65cf0ba3c302
|
| 3 |
-
size 165164
|
|
|
|
|
|
|
|
|
|
|
|
data/trajets_frequents.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{"depart": "Parcelles Assainies", "arrivee": "Palais"},
|
| 3 |
+
{"depart": "Parcelles Assainies", "arrivee": "UCAD"},
|
| 4 |
+
{"depart": "Guédiawaye", "arrivee": "Colobane"},
|
| 5 |
+
{"depart": "Guédiawaye", "arrivee": "Palais"},
|
| 6 |
+
{"depart": "Pikine", "arrivee": "Colobane"},
|
| 7 |
+
{"depart": "Pikine", "arrivee": "Petersen"},
|
| 8 |
+
{"depart": "Keur Massar", "arrivee": "UCAD"},
|
| 9 |
+
{"depart": "Keur Massar", "arrivee": "Colobane"},
|
| 10 |
+
{"depart": "Rufisque", "arrivee": "Colobane"},
|
| 11 |
+
{"depart": "Rufisque", "arrivee": "Palais"},
|
| 12 |
+
{"depart": "Malika", "arrivee": "Palais"},
|
| 13 |
+
{"depart": "Yeumbeul", "arrivee": "Colobane"},
|
| 14 |
+
{"depart": "Thiaroye", "arrivee": "Petersen"},
|
| 15 |
+
{"depart": "Thiaroye", "arrivee": "UCAD"},
|
| 16 |
+
{"depart": "Mbao", "arrivee": "Petersen"},
|
| 17 |
+
{"depart": "Cambérène", "arrivee": "Colobane"},
|
| 18 |
+
{"depart": "Liberté 5", "arrivee": "Palais"},
|
| 19 |
+
{"depart": "Liberté 6", "arrivee": "Petersen"},
|
| 20 |
+
{"depart": "HLM", "arrivee": "Petersen"},
|
| 21 |
+
{"depart": "Grand Yoff", "arrivee": "Palais"},
|
| 22 |
+
{"depart": "Ouakam", "arrivee": "Palais"},
|
| 23 |
+
{"depart": "Mermoz", "arrivee": "Palais"},
|
| 24 |
+
{"depart": "Yoff", "arrivee": "Petersen"},
|
| 25 |
+
{"depart": "Almadies", "arrivee": "Palais"},
|
| 26 |
+
{"depart": "Patte d'Oie", "arrivee": "UCAD"},
|
| 27 |
+
{"depart": "Aéroport", "arrivee": "Palais"},
|
| 28 |
+
{"depart": "Médina", "arrivee": "Parcelles Assainies"},
|
| 29 |
+
{"depart": "Fass", "arrivee": "Guédiawaye"},
|
| 30 |
+
{"depart": "Grand Dakar", "arrivee": "Pikine"},
|
| 31 |
+
{"depart": "Sahm", "arrivee": "Colobane"},
|
| 32 |
+
{"depart": "Colobane", "arrivee": "Guédiawaye"},
|
| 33 |
+
{"depart": "Petersen", "arrivee": "Keur Massar"},
|
| 34 |
+
{"depart": "UCAD", "arrivee": "Parcelles Assainies"}
|
| 35 |
+
]
|