JamboGPT Bot commited on
Commit Β·
0d94fc9
1
Parent(s): 60aa80a
Integrate Crane AI Labs models (Swahili & Luganda Gemma)
Browse files
app.py
CHANGED
|
@@ -1,889 +1,499 @@
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
-
JamboGPT -
|
| 4 |
-
|
| 5 |
"""
|
| 6 |
|
| 7 |
-
import os
|
| 8 |
import gradio as gr
|
| 9 |
-
import torch
|
| 10 |
-
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
| 11 |
-
import numpy as np
|
| 12 |
-
from scipy.io import wavfile
|
| 13 |
-
import tempfile
|
| 14 |
-
from datetime import datetime
|
| 15 |
import json
|
| 16 |
-
import
|
| 17 |
-
from collections import defaultdict
|
| 18 |
-
|
| 19 |
-
# Set device
|
| 20 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 21 |
-
print(f"π Starting JamboGPT - Enterprise African Language AI")
|
| 22 |
-
print(f"Using device: {device}")
|
| 23 |
-
print("=" * 60)
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
|
|
|
|
| 29 |
LANGUAGES = {
|
| 30 |
"Swahili": {
|
| 31 |
"code": "swh",
|
| 32 |
-
"tts_model": "facebook/mms-tts-swh",
|
| 33 |
"emoji": "π°πͺ",
|
| 34 |
"speakers": "100M+",
|
| 35 |
"region": "East Africa",
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
"
|
| 39 |
-
"
|
| 40 |
-
"
|
| 41 |
-
"
|
| 42 |
-
"
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
"
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
"
|
| 55 |
-
"
|
| 56 |
-
"
|
| 57 |
-
|
| 58 |
-
"context_memory": 10,
|
| 59 |
-
"confidence_threshold": 0.75
|
| 60 |
},
|
| 61 |
"Kikuyu": {
|
| 62 |
"code": "ki",
|
| 63 |
-
"tts_model": "BrianMwangi/African-Kikuyu-TTS",
|
| 64 |
"emoji": "π°πͺ",
|
| 65 |
-
"speakers": "7M",
|
| 66 |
-
"region": "
|
| 67 |
-
"
|
| 68 |
-
"
|
| 69 |
-
"
|
| 70 |
-
"
|
| 71 |
-
"
|
| 72 |
-
"
|
| 73 |
-
"
|
| 74 |
-
|
| 75 |
-
"affirmative": ["Δ©Δ©", "yes", "mwega"],
|
| 76 |
-
"negative": ["Ε©ta", "no", "siyo"],
|
| 77 |
-
"question": ["nΔ©", "what", "why", "how"]
|
| 78 |
-
},
|
| 79 |
-
"responses": {
|
| 80 |
-
"greeting": "WΔ© mwega! NΔ© mwega! Unajifunza nini?",
|
| 81 |
-
"help": "NΔ© mwega! NΔ©kΔ©o kΔ©ndΕ© kΔ©rΔ©a Ε©rΔ© na kΔ©o?",
|
| 82 |
-
"thanks": "Mwega muno! NΔ© mwega.",
|
| 83 |
-
"bye": "RΔ©a rΔ©u! WΔ© mwega!",
|
| 84 |
-
"affirmative": "Δ¨Δ©, nΔ©guo mwega!",
|
| 85 |
-
"negative": "Ε¨ta, siyo hivyo.",
|
| 86 |
-
"question": "NΔ© mwega! NΔ©kΔ©o kΔ©ndΕ© kΔ©rΔ©a mwega!",
|
| 87 |
-
"default": "NΔ©guo mwega! WΔ© Ε©rΔ©a mwega?"
|
| 88 |
-
},
|
| 89 |
-
"context_memory": 8,
|
| 90 |
-
"confidence_threshold": 0.70
|
| 91 |
},
|
| 92 |
"Yoruba": {
|
| 93 |
"code": "yor",
|
| 94 |
-
"tts_model": "facebook/mms-tts-yor",
|
| 95 |
"emoji": "π³π¬",
|
| 96 |
-
"speakers": "45M",
|
| 97 |
"region": "West Africa",
|
| 98 |
-
"
|
| 99 |
-
"
|
| 100 |
-
"
|
| 101 |
-
"
|
| 102 |
-
"
|
| 103 |
-
"
|
| 104 |
-
"
|
| 105 |
-
|
| 106 |
-
"affirmative": ["bαΊΉαΊΉ", "yes", "o dara"],
|
| 107 |
-
"negative": ["rara", "no", "kΓ²"],
|
| 108 |
-
"question": ["kini", "what", "why", "how"]
|
| 109 |
-
},
|
| 110 |
-
"responses": {
|
| 111 |
-
"greeting": "PαΊΉlαΊΉ o! Bawo ni o se? αΊΈ kΓΊ Γ rα»!",
|
| 112 |
-
"help": "Mo le lα»wα» rαΊΉ. Kini nkan ti o nilo?",
|
| 113 |
-
"thanks": "E ku α»pαΊΉ! αΊΈ kΓΊ α»jα»Μ!",
|
| 114 |
-
"bye": "Γ dÑà bΓ²! αΊΈ kΓΊ α»jα»Μ!",
|
| 115 |
-
"affirmative": "BαΊΉαΊΉ, o dara!",
|
| 116 |
-
"negative": "Rara, kΓ² dara.",
|
| 117 |
-
"question": "Kini nkan? Mo le lα»wα» rαΊΉ!",
|
| 118 |
-
"default": "Yoo, mo gbe e. Kini nkan ti o nilo?"
|
| 119 |
-
},
|
| 120 |
-
"context_memory": 10,
|
| 121 |
-
"confidence_threshold": 0.72
|
| 122 |
},
|
| 123 |
"Hausa": {
|
| 124 |
"code": "hau",
|
| 125 |
-
"tts_model": "facebook/mms-tts-hau",
|
| 126 |
"emoji": "π³π¬",
|
| 127 |
-
"speakers": "90M",
|
| 128 |
"region": "West Africa",
|
| 129 |
-
"
|
| 130 |
-
"
|
| 131 |
-
"
|
| 132 |
-
"
|
| 133 |
-
"
|
| 134 |
-
"
|
| 135 |
-
"
|
| 136 |
-
|
| 137 |
-
"affirmative": ["i", "yes", "haka"],
|
| 138 |
-
"negative": ["a'a", "no", "ba"],
|
| 139 |
-
"question": ["me", "what", "why", "how"]
|
| 140 |
-
},
|
| 141 |
-
"responses": {
|
| 142 |
-
"greeting": "Sannu! Ina kwana? Na gida!",
|
| 143 |
-
"help": "Ina iya taimakawa ka. Me na gida!",
|
| 144 |
-
"thanks": "Nagode! Na gida!",
|
| 145 |
-
"bye": "Sai anjima! Jiya!",
|
| 146 |
-
"affirmative": "I, haka!",
|
| 147 |
-
"negative": "A'a, ba haka.",
|
| 148 |
-
"question": "Me na gida? Ina iya taimakawa!",
|
| 149 |
-
"default": "Yoo, na ji ka. Me na gida!"
|
| 150 |
-
},
|
| 151 |
-
"context_memory": 10,
|
| 152 |
-
"confidence_threshold": 0.70
|
| 153 |
},
|
| 154 |
"Amharic": {
|
| 155 |
"code": "amh",
|
| 156 |
-
"tts_model": "facebook/mms-tts-amh",
|
| 157 |
"emoji": "πͺπΉ",
|
| 158 |
-
"speakers": "32M",
|
| 159 |
-
"region": "
|
| 160 |
-
"
|
| 161 |
-
"
|
| 162 |
-
"
|
| 163 |
-
"
|
| 164 |
-
"
|
| 165 |
-
"
|
| 166 |
-
"
|
| 167 |
-
|
| 168 |
-
"affirmative": ["α α", "yes", "ααα"],
|
| 169 |
-
"negative": ["α α", "no", "αα"],
|
| 170 |
-
"question": ["αα", "what", "why", "how"]
|
| 171 |
-
},
|
| 172 |
-
"responses": {
|
| 173 |
-
"greeting": "α°αα! α₯αα°αα αα
? α°α
α!",
|
| 174 |
-
"help": "αα¨α³α
α₯α½αααα’ αα α«α΅ααααα?",
|
| 175 |
-
"thanks": "α αα°αααα! α°α
α!",
|
| 176 |
-
"bye": "α°α
α αα! α°αα!",
|
| 177 |
-
"affirmative": "α α, ααα!",
|
| 178 |
-
"negative": "α α, αα.",
|
| 179 |
-
"question": "αα αα? αα¨α³α
α₯α½ααα!",
|
| 180 |
-
"default": "αααα’ αα αα αα¨α³α
αα½αα?"
|
| 181 |
-
},
|
| 182 |
-
"context_memory": 10,
|
| 183 |
-
"confidence_threshold": 0.75
|
| 184 |
},
|
| 185 |
"Fon": {
|
| 186 |
"code": "fon",
|
| 187 |
-
"tts_model": "facebook/mms-tts-fon",
|
| 188 |
"emoji": "π§π―",
|
| 189 |
-
"speakers": "2M",
|
| 190 |
-
"region": "
|
| 191 |
-
"
|
| 192 |
-
"
|
| 193 |
-
"
|
| 194 |
-
"
|
| 195 |
-
"
|
| 196 |
-
"
|
| 197 |
-
"
|
| 198 |
-
|
| 199 |
-
"affirmative": ["yoo", "yes", "o dara"],
|
| 200 |
-
"negative": ["rara", "no", "kΓ²"],
|
| 201 |
-
"question": ["kini", "what", "why"]
|
| 202 |
-
},
|
| 203 |
-
"responses": {
|
| 204 |
-
"greeting": "Alekun! Inu mαΊΉ? O dara!",
|
| 205 |
-
"help": "MαΊΉ lαΊΉ wαΊΉ mαΊΉ. Kini nkan?",
|
| 206 |
-
"thanks": "E ku α»pαΊΉ! αΊΈ kΓΊ!",
|
| 207 |
-
"bye": "Γ dÑà bΓ²! αΊΈ kΓΊ α»jα»Μ!",
|
| 208 |
-
"affirmative": "Yoo, o dara!",
|
| 209 |
-
"negative": "Rara, kΓ² dara.",
|
| 210 |
-
"question": "Kini nkan? MαΊΉ lαΊΉ wαΊΉ mαΊΉ!",
|
| 211 |
-
"default": "Yoo, mo gbe e. Kini nkan?"
|
| 212 |
-
},
|
| 213 |
-
"context_memory": 8,
|
| 214 |
-
"confidence_threshold": 0.68
|
| 215 |
},
|
| 216 |
"Oromo": {
|
| 217 |
"code": "orm",
|
| 218 |
-
"tts_model": "facebook/mms-tts-orm",
|
| 219 |
"emoji": "πͺπΉ",
|
| 220 |
-
"speakers": "40M",
|
| 221 |
-
"region": "
|
| 222 |
-
"
|
| 223 |
-
"
|
| 224 |
-
"
|
| 225 |
-
"
|
| 226 |
-
"
|
| 227 |
-
"
|
| 228 |
-
"
|
| 229 |
-
|
| 230 |
-
"affirmative": ["eeyyee", "yes", "eeyyee"],
|
| 231 |
-
"negative": ["lakk", "no", "miti"],
|
| 232 |
-
"question": ["maal", "what", "why"]
|
| 233 |
-
},
|
| 234 |
-
"responses": {
|
| 235 |
-
"greeting": "Salaam! Akkam jirta? Nagaa!",
|
| 236 |
-
"help": "Gargaaruu dandeenya. Maal barbaadda?",
|
| 237 |
-
"thanks": "Galatomi! Nagaa!",
|
| 238 |
-
"bye": "Nagaa! Booda beekta!",
|
| 239 |
-
"affirmative": "Eeyyee, hubadhe!",
|
| 240 |
-
"negative": "Lakk, miti.",
|
| 241 |
-
"question": "Maal barbaadda? Gargaaruu dandeenya!",
|
| 242 |
-
"default": "Eeyyee, hubadhe. Maal biraa?"
|
| 243 |
-
},
|
| 244 |
-
"context_memory": 10,
|
| 245 |
-
"confidence_threshold": 0.72
|
| 246 |
},
|
| 247 |
"Somali": {
|
| 248 |
"code": "som",
|
| 249 |
-
"tts_model": "facebook/mms-tts-som",
|
| 250 |
"emoji": "πΈπ΄",
|
| 251 |
-
"speakers": "20M",
|
| 252 |
"region": "East Africa",
|
| 253 |
-
"
|
| 254 |
-
"
|
| 255 |
-
"
|
| 256 |
-
"
|
| 257 |
-
"
|
| 258 |
-
"
|
| 259 |
-
"
|
| 260 |
-
|
| 261 |
-
"affirmative": ["hah", "yes", "waa"],
|
| 262 |
-
"negative": ["maya", "no", "maa"],
|
| 263 |
-
"question": ["maxaa", "what", "why"]
|
| 264 |
-
},
|
| 265 |
-
"responses": {
|
| 266 |
-
"greeting": "Salaam! Iska warran? Nabad!",
|
| 267 |
-
"help": "Waan kaa caawin karaa. Maxaad doonaysaa?",
|
| 268 |
-
"thanks": "Mahadsanid! Nabad!",
|
| 269 |
-
"bye": "Nabad! Marka danbe!",
|
| 270 |
-
"affirmative": "Hah, waa!",
|
| 271 |
-
"negative": "Maya, maa.",
|
| 272 |
-
"question": "Maxaa? Waan kaa caawin karaa!",
|
| 273 |
-
"default": "Hah, waan ogsadaye. Wax kale?"
|
| 274 |
-
},
|
| 275 |
-
"context_memory": 10,
|
| 276 |
-
"confidence_threshold": 0.70
|
| 277 |
},
|
| 278 |
"Tigrinya": {
|
| 279 |
"code": "tir",
|
| 280 |
-
"tts_model": "facebook/mms-tts-tir",
|
| 281 |
"emoji": "πͺπ·",
|
| 282 |
-
"speakers": "7M",
|
| 283 |
"region": "Horn of Africa",
|
| 284 |
-
"
|
| 285 |
-
"
|
| 286 |
-
"
|
| 287 |
-
"
|
| 288 |
-
"
|
| 289 |
-
"
|
| 290 |
-
"
|
| 291 |
-
|
| 292 |
-
"affirmative": ["α", "yes", "α"],
|
| 293 |
-
"negative": ["α£α", "no", "α£α"],
|
| 294 |
-
"question": ["α₯αα³α", "what", "why"]
|
| 295 |
-
},
|
| 296 |
-
"responses": {
|
| 297 |
-
"greeting": "α°αα! ααα α²α«? α°α
α!",
|
| 298 |
-
"help": "αα ααα αα½α₯αα’ α₯αα³α α΅α°αα©?",
|
| 299 |
-
"thanks": "α΅α! αα α°αα!",
|
| 300 |
-
"bye": "α°αα! ααα!",
|
| 301 |
-
"affirmative": "α, α!",
|
| 302 |
-
"negative": "α£α, α£α.",
|
| 303 |
-
"question": "α₯αα³α? αα ααα αα½α₯α!",
|
| 304 |
-
"default": "ααα’ α₯αα³α α°αα³αΊ?"
|
| 305 |
-
},
|
| 306 |
-
"context_memory": 8,
|
| 307 |
-
"confidence_threshold": 0.68
|
| 308 |
},
|
| 309 |
"English": {
|
| 310 |
"code": "eng",
|
| 311 |
-
"tts_model": "facebook/mms-tts-eng",
|
| 312 |
"emoji": "π",
|
| 313 |
-
"speakers": "1.5B",
|
| 314 |
"region": "Global",
|
| 315 |
-
"
|
| 316 |
-
"
|
| 317 |
-
"
|
| 318 |
-
"
|
| 319 |
-
"
|
| 320 |
-
"
|
| 321 |
-
"
|
| 322 |
-
|
| 323 |
-
"affirmative": ["yes", "yeah", "sure", "okay"],
|
| 324 |
-
"negative": ["no", "nope", "not", "never"],
|
| 325 |
-
"question": ["what", "why", "how", "when"]
|
| 326 |
-
},
|
| 327 |
-
"responses": {
|
| 328 |
-
"greeting": "Hello! How can I help you today? I'm here to assist.",
|
| 329 |
-
"help": "I can help you with English. What would you like to know?",
|
| 330 |
-
"thanks": "Thank you! Happy to help! You're welcome!",
|
| 331 |
-
"bye": "Goodbye! See you later! Have a great day!",
|
| 332 |
-
"affirmative": "Yes, absolutely! I understand!",
|
| 333 |
-
"negative": "No, that's not right. Let me help clarify.",
|
| 334 |
-
"question": "Great question! I can help with that!",
|
| 335 |
-
"default": "I understand. What else can I help you with?"
|
| 336 |
-
},
|
| 337 |
-
"context_memory": 15,
|
| 338 |
-
"confidence_threshold": 0.80
|
| 339 |
}
|
| 340 |
}
|
| 341 |
|
| 342 |
-
#
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
}
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
}
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
margin: 0;
|
| 393 |
-
opacity: 0.95;
|
| 394 |
-
line-height: 1.6;
|
| 395 |
-
}
|
| 396 |
-
|
| 397 |
-
.stats-premium {
|
| 398 |
-
display: flex;
|
| 399 |
-
justify-content: center;
|
| 400 |
-
gap: 80px;
|
| 401 |
-
margin-top: 40px;
|
| 402 |
-
flex-wrap: wrap;
|
| 403 |
-
}
|
| 404 |
-
|
| 405 |
-
.stat-premium {
|
| 406 |
-
text-align: center;
|
| 407 |
-
}
|
| 408 |
-
|
| 409 |
-
.stat-number-premium {
|
| 410 |
-
font-size: 42px;
|
| 411 |
-
font-weight: 900;
|
| 412 |
-
display: block;
|
| 413 |
-
font-family: 'Playfair Display', serif;
|
| 414 |
-
}
|
| 415 |
-
|
| 416 |
-
.stat-label-premium {
|
| 417 |
-
font-size: 12px;
|
| 418 |
-
opacity: 0.9;
|
| 419 |
-
text-transform: uppercase;
|
| 420 |
-
letter-spacing: 2px;
|
| 421 |
-
margin-top: 4px;
|
| 422 |
-
}
|
| 423 |
-
|
| 424 |
-
/* Content Grid */
|
| 425 |
-
.content-grid-premium {
|
| 426 |
-
display: grid;
|
| 427 |
-
grid-template-columns: 1fr 1fr;
|
| 428 |
-
gap: 30px;
|
| 429 |
-
margin-bottom: 40px;
|
| 430 |
-
}
|
| 431 |
-
|
| 432 |
-
/* Language Cards */
|
| 433 |
-
.languages-premium {
|
| 434 |
-
background: rgba(255, 255, 255, 0.95);
|
| 435 |
-
border-radius: 20px;
|
| 436 |
-
padding: 40px;
|
| 437 |
-
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
|
| 438 |
-
backdrop-filter: blur(10px);
|
| 439 |
-
}
|
| 440 |
-
|
| 441 |
-
.section-title-premium {
|
| 442 |
-
font-family: 'Playfair Display', serif;
|
| 443 |
-
font-size: 24px;
|
| 444 |
-
font-weight: 900;
|
| 445 |
-
margin-bottom: 30px;
|
| 446 |
-
color: #1a1a1a;
|
| 447 |
-
}
|
| 448 |
-
|
| 449 |
-
.languages-grid-premium {
|
| 450 |
-
display: grid;
|
| 451 |
-
grid-template-columns: repeat(3, 1fr);
|
| 452 |
-
gap: 15px;
|
| 453 |
-
}
|
| 454 |
-
|
| 455 |
-
.lang-card-premium {
|
| 456 |
-
background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
|
| 457 |
-
border: 2px solid #667eea30;
|
| 458 |
-
border-radius: 15px;
|
| 459 |
-
padding: 20px;
|
| 460 |
-
text-align: center;
|
| 461 |
-
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
| 462 |
-
cursor: pointer;
|
| 463 |
-
}
|
| 464 |
-
|
| 465 |
-
.lang-card-premium:hover {
|
| 466 |
-
background: linear-gradient(135deg, #667eea35 0%, #764ba235 100%);
|
| 467 |
-
border-color: #667eea80;
|
| 468 |
-
transform: translateY(-8px);
|
| 469 |
-
box-shadow: 0 20px 40px rgba(102, 126, 234, 0.25);
|
| 470 |
-
}
|
| 471 |
-
|
| 472 |
-
.lang-emoji-premium {
|
| 473 |
-
font-size: 32px;
|
| 474 |
-
margin-bottom: 10px;
|
| 475 |
-
}
|
| 476 |
-
|
| 477 |
-
.lang-name-premium {
|
| 478 |
-
font-size: 14px;
|
| 479 |
-
font-weight: 700;
|
| 480 |
-
color: #1a1a1a;
|
| 481 |
-
margin-bottom: 4px;
|
| 482 |
-
}
|
| 483 |
-
|
| 484 |
-
.lang-speakers-premium {
|
| 485 |
-
font-size: 11px;
|
| 486 |
-
color: #666;
|
| 487 |
-
}
|
| 488 |
-
|
| 489 |
-
.lang-quality-premium {
|
| 490 |
-
font-size: 10px;
|
| 491 |
-
color: #667eea;
|
| 492 |
-
font-weight: 600;
|
| 493 |
-
margin-top: 6px;
|
| 494 |
-
}
|
| 495 |
-
|
| 496 |
-
/* Chat Section */
|
| 497 |
-
.chat-premium {
|
| 498 |
-
background: rgba(255, 255, 255, 0.95);
|
| 499 |
-
border-radius: 20px;
|
| 500 |
-
padding: 40px;
|
| 501 |
-
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
|
| 502 |
-
backdrop-filter: blur(10px);
|
| 503 |
-
}
|
| 504 |
-
|
| 505 |
-
/* Form Elements */
|
| 506 |
-
select, textarea {
|
| 507 |
-
width: 100% !important;
|
| 508 |
-
padding: 14px 16px !important;
|
| 509 |
-
border: 2px solid #e0e0e0 !important;
|
| 510 |
-
border-radius: 12px !important;
|
| 511 |
-
font-size: 14px !important;
|
| 512 |
-
font-family: 'Poppins', sans-serif !important;
|
| 513 |
-
background: #fafbfc !important;
|
| 514 |
-
color: #1a1a1a !important;
|
| 515 |
-
transition: all 0.3s ease !important;
|
| 516 |
-
}
|
| 517 |
-
|
| 518 |
-
select:hover, textarea:hover {
|
| 519 |
-
border-color: #667eea !important;
|
| 520 |
-
background: #fff !important;
|
| 521 |
-
}
|
| 522 |
-
|
| 523 |
-
select:focus, textarea:focus {
|
| 524 |
-
outline: none !important;
|
| 525 |
-
border-color: #667eea !important;
|
| 526 |
-
background: #fff !important;
|
| 527 |
-
box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15) !important;
|
| 528 |
-
}
|
| 529 |
-
|
| 530 |
-
/* Premium Buttons */
|
| 531 |
-
button {
|
| 532 |
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
| 533 |
-
color: white !important;
|
| 534 |
-
border: none !important;
|
| 535 |
-
border-radius: 12px !important;
|
| 536 |
-
padding: 14px 32px !important;
|
| 537 |
-
font-weight: 700 !important;
|
| 538 |
-
font-size: 15px !important;
|
| 539 |
-
cursor: pointer !important;
|
| 540 |
-
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
|
| 541 |
-
box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35) !important;
|
| 542 |
-
}
|
| 543 |
-
|
| 544 |
-
button:hover {
|
| 545 |
-
transform: translateY(-4px) !important;
|
| 546 |
-
box-shadow: 0 12px 32px rgba(102, 126, 234, 0.45) !important;
|
| 547 |
-
}
|
| 548 |
-
|
| 549 |
-
button:active {
|
| 550 |
-
transform: translateY(-2px) !important;
|
| 551 |
-
}
|
| 552 |
-
|
| 553 |
-
/* Output Section */
|
| 554 |
-
.output-premium {
|
| 555 |
-
background: rgba(255, 255, 255, 0.95);
|
| 556 |
-
border-radius: 20px;
|
| 557 |
-
padding: 40px;
|
| 558 |
-
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
|
| 559 |
-
margin-bottom: 40px;
|
| 560 |
-
}
|
| 561 |
-
|
| 562 |
-
.output-grid-premium {
|
| 563 |
-
display: grid;
|
| 564 |
-
grid-template-columns: 1fr 1fr;
|
| 565 |
-
gap: 30px;
|
| 566 |
-
}
|
| 567 |
-
|
| 568 |
-
.output-box-premium {
|
| 569 |
-
background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
|
| 570 |
-
border: 2px solid #e0e0e0;
|
| 571 |
-
border-radius: 12px;
|
| 572 |
-
padding: 20px;
|
| 573 |
-
min-height: 100px;
|
| 574 |
-
color: #1a1a1a;
|
| 575 |
-
font-size: 14px;
|
| 576 |
-
line-height: 1.6;
|
| 577 |
-
}
|
| 578 |
-
|
| 579 |
-
/* Footer */
|
| 580 |
-
.footer-premium {
|
| 581 |
-
text-align: center;
|
| 582 |
-
padding: 40px 20px;
|
| 583 |
-
color: #999;
|
| 584 |
-
font-size: 13px;
|
| 585 |
-
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
| 586 |
-
margin-top: 40px;
|
| 587 |
-
}
|
| 588 |
-
|
| 589 |
-
.footer-premium a {
|
| 590 |
-
color: #667eea;
|
| 591 |
-
text-decoration: none;
|
| 592 |
-
font-weight: 600;
|
| 593 |
}
|
| 594 |
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 598 |
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
grid-template-columns: 1fr;
|
| 603 |
-
}
|
| 604 |
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
}
|
| 608 |
|
| 609 |
-
|
| 610 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 611 |
}
|
| 612 |
-
|
|
|
|
| 613 |
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
padding: 40px 20px;
|
| 617 |
-
}
|
| 618 |
|
| 619 |
-
|
| 620 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 621 |
}
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
|
|
|
| 625 |
}
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
|
|
|
| 629 |
}
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
}
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
responses = lang_config.get("responses", {})
|
| 687 |
-
|
| 688 |
-
intent = detect_intent(text, language)
|
| 689 |
-
response = responses.get(intent, responses.get("default", "I understand."))
|
| 690 |
-
|
| 691 |
-
# Store in conversation history
|
| 692 |
-
conversation_history[user_id].append({
|
| 693 |
-
"timestamp": datetime.now().isoformat(),
|
| 694 |
-
"language": language,
|
| 695 |
-
"user_input": text,
|
| 696 |
-
"intent": intent,
|
| 697 |
-
"agent_response": response
|
| 698 |
-
})
|
| 699 |
-
|
| 700 |
-
# Update analytics
|
| 701 |
-
user_analytics[user_id]["messages"] += 1
|
| 702 |
-
user_analytics[user_id]["languages"].add(language)
|
| 703 |
-
user_analytics[user_id]["last_active"] = datetime.now().isoformat()
|
| 704 |
-
|
| 705 |
-
confidence = lang_config.get("confidence_threshold", 0.75)
|
| 706 |
-
|
| 707 |
-
return response, f"β
Response generated (Confidence: {confidence*100:.0f}%)"
|
| 708 |
-
except Exception as e:
|
| 709 |
-
print(f"β Error generating response: {e}")
|
| 710 |
-
return None, f"β Error: {str(e)}"
|
| 711 |
-
|
| 712 |
-
def synthesize_speech(text, language):
|
| 713 |
-
"""Convert text to speech with quality metrics."""
|
| 714 |
-
if not text or not text.strip():
|
| 715 |
-
return None, "β No text to synthesize."
|
| 716 |
-
|
| 717 |
-
try:
|
| 718 |
-
synthesizer = load_tts_model(language)
|
| 719 |
-
if synthesizer is None:
|
| 720 |
-
return None, f"β Failed to load TTS model for {language}."
|
| 721 |
-
|
| 722 |
-
print(f"π€ Generating speech for: {text[:50]}...")
|
| 723 |
-
speech = synthesizer(text)
|
| 724 |
-
|
| 725 |
-
audio_array = np.array(speech["audio"]).flatten()
|
| 726 |
-
sample_rate = speech["sampling_rate"]
|
| 727 |
-
|
| 728 |
-
lang_config = LANGUAGES.get(language, {})
|
| 729 |
-
quality_score = lang_config.get("quality_score", 8.5)
|
| 730 |
-
|
| 731 |
-
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as f:
|
| 732 |
-
wavfile.write(f.name, sample_rate, (audio_array * 32767).astype(np.int16))
|
| 733 |
-
temp_path = f.name
|
| 734 |
-
|
| 735 |
-
return temp_path, f"β
Speech generated (Quality: {quality_score}/10)"
|
| 736 |
-
except Exception as e:
|
| 737 |
-
print(f"β Error synthesizing: {e}")
|
| 738 |
-
return None, f"β Error: {str(e)}"
|
| 739 |
-
|
| 740 |
-
def process_text_input(text, language, user_id="default"):
|
| 741 |
-
"""Process input: generate response -> synthesize."""
|
| 742 |
-
try:
|
| 743 |
-
response_text, response_status = generate_response(text, language, user_id)
|
| 744 |
-
if response_text is None:
|
| 745 |
-
return None, response_text, response_status
|
| 746 |
-
|
| 747 |
-
audio_output, synth_status = synthesize_speech(response_text, language)
|
| 748 |
-
|
| 749 |
-
return audio_output, response_text, synth_status
|
| 750 |
-
except Exception as e:
|
| 751 |
-
print(f"β Error processing: {e}")
|
| 752 |
-
return None, None, f"β Error: {str(e)}"
|
| 753 |
-
|
| 754 |
-
def create_interface():
|
| 755 |
-
"""Create premium interface."""
|
| 756 |
|
| 757 |
with gr.Blocks(
|
| 758 |
-
|
| 759 |
-
css=
|
| 760 |
-
theme=gr.themes.Soft()
|
| 761 |
) as demo:
|
| 762 |
-
|
| 763 |
# Header
|
| 764 |
gr.HTML("""
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
|
| 770 |
-
|
| 771 |
-
|
| 772 |
-
|
| 773 |
-
|
| 774 |
-
|
| 775 |
-
|
| 776 |
-
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
</div>
|
| 786 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 787 |
""")
|
| 788 |
|
| 789 |
-
#
|
| 790 |
-
with gr.
|
| 791 |
-
#
|
| 792 |
-
with gr.Column():
|
| 793 |
-
gr.HTML("""
|
| 794 |
-
<div class="languages-premium">
|
| 795 |
-
<div class="section-title-premium">π£οΈ Supported Languages</div>
|
| 796 |
-
<div class="languages-grid-premium">
|
| 797 |
-
<div class="lang-card-premium"><div class="lang-emoji-premium">π°πͺ</div><div class="lang-name-premium">Swahili</div><div class="lang-speakers-premium">100M+</div><div class="lang-quality-premium">β 9.5/10</div></div>
|
| 798 |
-
<div class="lang-card-premium"><div class="lang-emoji-premium">π°πͺ</div><div class="lang-name-premium">Kikuyu</div><div class="lang-speakers-premium">7M</div><div class="lang-quality-premium">β 9.2/10</div></div>
|
| 799 |
-
<div class="lang-card-premium"><div class="lang-emoji-premium">π³π¬</div><div class="lang-name-premium">Yoruba</div><div class="lang-speakers-premium">45M</div><div class="lang-quality-premium">β 9.0/10</div></div>
|
| 800 |
-
<div class="lang-card-premium"><div class="lang-emoji-premium">π³π¬</div><div class="lang-name-premium">Hausa</div><div class="lang-speakers-premium">90M</div><div class="lang-quality-premium">β 8.8/10</div></div>
|
| 801 |
-
<div class="lang-card-premium"><div class="lang-emoji-premium">πͺπΉ</div><div class="lang-name-premium">Amharic</div><div class="lang-speakers-premium">32M</div><div class="lang-quality-premium">β 8.9/10</div></div>
|
| 802 |
-
<div class="lang-card-premium"><div class="lang-emoji-premium">π§π―</div><div class="lang-name-premium">Fon</div><div class="lang-speakers-premium">2M</div><div class="lang-quality-premium">β 8.5/10</div></div>
|
| 803 |
-
<div class="lang-card-premium"><div class="lang-emoji-premium">πͺπΉ</div><div class="lang-name-premium">Oromo</div><div class="lang-speakers-premium">40M</div><div class="lang-quality-premium">β 8.7/10</div></div>
|
| 804 |
-
<div class="lang-card-premium"><div class="lang-emoji-premium">πΈπ΄</div><div class="lang-name-premium">Somali</div><div class="lang-speakers-premium">20M</div><div class="lang-quality-premium">β 8.6/10</div></div>
|
| 805 |
-
<div class="lang-card-premium"><div class="lang-emoji-premium">πͺπ·</div><div class="lang-name-premium">Tigrinya</div><div class="lang-speakers-premium">7M</div><div class="lang-quality-premium">β 8.4/10</div></div>
|
| 806 |
-
</div>
|
| 807 |
-
</div>
|
| 808 |
-
""")
|
| 809 |
|
| 810 |
-
|
| 811 |
-
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 815 |
choices=list(LANGUAGES.keys()),
|
| 816 |
value="Swahili",
|
| 817 |
label="Select Language",
|
| 818 |
interactive=True
|
| 819 |
)
|
| 820 |
-
|
| 821 |
-
|
| 822 |
-
|
|
|
|
| 823 |
placeholder="Type in your selected language...",
|
| 824 |
-
lines=
|
| 825 |
-
interactive=True
|
| 826 |
)
|
| 827 |
-
|
| 828 |
-
|
| 829 |
-
|
| 830 |
-
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
|
| 836 |
-
gr.HTML('<div class="output-premium"><div class="section-title-premium">π Results</div><div class="output-grid-premium">')
|
| 837 |
-
|
| 838 |
-
with gr.Row():
|
| 839 |
-
with gr.Column():
|
| 840 |
-
gr.Markdown("**π€ Agent Response**")
|
| 841 |
-
agent_response = gr.Textbox(
|
| 842 |
-
label="",
|
| 843 |
interactive=False,
|
| 844 |
-
|
| 845 |
)
|
| 846 |
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 854 |
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
value="π Ready for enterprise conversations!"
|
| 859 |
)
|
| 860 |
|
| 861 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 862 |
|
| 863 |
# Footer
|
| 864 |
-
gr.
|
| 865 |
-
|
| 866 |
-
|
| 867 |
-
<p><a href="https://huggingface.co/spaces/stano03/jambogpt">Hugging Face</a> β’ <a href="https://github.com/stano03/jambogpt">GitHub</a> β’ <a href="https://huggingface.co/datasets/stano03/jambogpt-kenyan-languages">Dataset</a></p>
|
| 868 |
-
</div>
|
| 869 |
-
""")
|
| 870 |
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
|
| 875 |
-
|
| 876 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 877 |
|
| 878 |
return demo
|
| 879 |
|
| 880 |
if __name__ == "__main__":
|
| 881 |
-
print("π Creating JamboGPT
|
| 882 |
demo = create_interface()
|
| 883 |
|
| 884 |
-
print("
|
| 885 |
-
print("
|
| 886 |
-
print("
|
|
|
|
| 887 |
|
| 888 |
demo.launch(
|
| 889 |
server_name="0.0.0.0",
|
|
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
+
JamboGPT - African Language AI Voice Agent
|
| 4 |
+
Enhanced with Crane AI Labs Models (Swahili & Luganda Gemma)
|
| 5 |
"""
|
| 6 |
|
|
|
|
| 7 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
import json
|
| 9 |
+
from datetime import datetime
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
print("=" * 80)
|
| 12 |
+
print("π Starting JamboGPT - African Language AI")
|
| 13 |
+
print("=" * 80)
|
| 14 |
+
print("Enhanced with Crane AI Labs Models")
|
| 15 |
|
| 16 |
+
# Language configurations with Crane AI models
|
| 17 |
LANGUAGES = {
|
| 18 |
"Swahili": {
|
| 19 |
"code": "swh",
|
|
|
|
| 20 |
"emoji": "π°πͺ",
|
| 21 |
"speakers": "100M+",
|
| 22 |
"region": "East Africa",
|
| 23 |
+
"tts_model": "facebook/mms-tts-swh",
|
| 24 |
+
"llm_model": "CraneAILabs/swahili-gemma-1b",
|
| 25 |
+
"llm_available": True,
|
| 26 |
+
"examples": [
|
| 27 |
+
"Habari, karibu sana!",
|
| 28 |
+
"Niko hapa kusaidia kwa Kiswahili.",
|
| 29 |
+
"Unajifunza nini leo?",
|
| 30 |
+
]
|
| 31 |
+
},
|
| 32 |
+
"Luganda": {
|
| 33 |
+
"code": "lug",
|
| 34 |
+
"emoji": "πΊπ¬",
|
| 35 |
+
"speakers": "16M+",
|
| 36 |
+
"region": "East Africa",
|
| 37 |
+
"tts_model": "facebook/mms-tts-swh",
|
| 38 |
+
"llm_model": "CraneAILabs/ganda-gemma-1b",
|
| 39 |
+
"llm_available": True,
|
| 40 |
+
"examples": [
|
| 41 |
+
"Habari, karibu!",
|
| 42 |
+
"Nkuwa okukuyamba mu Luganda.",
|
| 43 |
+
"Oyigiriza ki leero?",
|
| 44 |
+
]
|
|
|
|
|
|
|
| 45 |
},
|
| 46 |
"Kikuyu": {
|
| 47 |
"code": "ki",
|
|
|
|
| 48 |
"emoji": "π°πͺ",
|
| 49 |
+
"speakers": "7M+",
|
| 50 |
+
"region": "Kenya",
|
| 51 |
+
"tts_model": "facebook/mms-tts-swh",
|
| 52 |
+
"llm_model": None,
|
| 53 |
+
"llm_available": False,
|
| 54 |
+
"examples": [
|
| 55 |
+
"WΔ© mwega, karibu!",
|
| 56 |
+
"NΔ© mwega kΕ©ruta.",
|
| 57 |
+
"Unajifunza nini?",
|
| 58 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
},
|
| 60 |
"Yoruba": {
|
| 61 |
"code": "yor",
|
|
|
|
| 62 |
"emoji": "π³π¬",
|
| 63 |
+
"speakers": "45M+",
|
| 64 |
"region": "West Africa",
|
| 65 |
+
"tts_model": "facebook/mms-tts-yor",
|
| 66 |
+
"llm_model": None,
|
| 67 |
+
"llm_available": False,
|
| 68 |
+
"examples": [
|
| 69 |
+
"PαΊΉlαΊΉ o, bawo ni o se?",
|
| 70 |
+
"αΊΈ kΓΊ Γ rα»!",
|
| 71 |
+
"Mo le lα»wα» rαΊΉ.",
|
| 72 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
},
|
| 74 |
"Hausa": {
|
| 75 |
"code": "hau",
|
|
|
|
| 76 |
"emoji": "π³π¬",
|
| 77 |
+
"speakers": "90M+",
|
| 78 |
"region": "West Africa",
|
| 79 |
+
"tts_model": "facebook/mms-tts-hau",
|
| 80 |
+
"llm_model": None,
|
| 81 |
+
"llm_available": False,
|
| 82 |
+
"examples": [
|
| 83 |
+
"Sannu, ina kwana?",
|
| 84 |
+
"Na gida!",
|
| 85 |
+
"Me na gida?",
|
| 86 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
},
|
| 88 |
"Amharic": {
|
| 89 |
"code": "amh",
|
|
|
|
| 90 |
"emoji": "πͺπΉ",
|
| 91 |
+
"speakers": "32M+",
|
| 92 |
+
"region": "Horn of Africa",
|
| 93 |
+
"tts_model": "facebook/mms-tts-amh",
|
| 94 |
+
"llm_model": None,
|
| 95 |
+
"llm_available": False,
|
| 96 |
+
"examples": [
|
| 97 |
+
"α°αα! α₯αα°αα αα
?",
|
| 98 |
+
"α°α
α! α°α
α!",
|
| 99 |
+
"αα α«α΅ααααα?",
|
| 100 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
},
|
| 102 |
"Fon": {
|
| 103 |
"code": "fon",
|
|
|
|
| 104 |
"emoji": "π§π―",
|
| 105 |
+
"speakers": "2M+",
|
| 106 |
+
"region": "West Africa",
|
| 107 |
+
"tts_model": "facebook/mms-tts-fon",
|
| 108 |
+
"llm_model": None,
|
| 109 |
+
"llm_available": False,
|
| 110 |
+
"examples": [
|
| 111 |
+
"Alekun o!",
|
| 112 |
+
"O dara!",
|
| 113 |
+
"Kini nkan?",
|
| 114 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
},
|
| 116 |
"Oromo": {
|
| 117 |
"code": "orm",
|
|
|
|
| 118 |
"emoji": "πͺπΉ",
|
| 119 |
+
"speakers": "40M+",
|
| 120 |
+
"region": "East Africa",
|
| 121 |
+
"tts_model": "facebook/mms-tts-orm",
|
| 122 |
+
"llm_model": None,
|
| 123 |
+
"llm_available": False,
|
| 124 |
+
"examples": [
|
| 125 |
+
"Salaam! Akkam jirta?",
|
| 126 |
+
"Nagaa, nagaa!",
|
| 127 |
+
"Maal barbaadda?",
|
| 128 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
},
|
| 130 |
"Somali": {
|
| 131 |
"code": "som",
|
|
|
|
| 132 |
"emoji": "πΈπ΄",
|
| 133 |
+
"speakers": "20M+",
|
| 134 |
"region": "East Africa",
|
| 135 |
+
"tts_model": "facebook/mms-tts-som",
|
| 136 |
+
"llm_model": None,
|
| 137 |
+
"llm_available": False,
|
| 138 |
+
"examples": [
|
| 139 |
+
"Salaam! Iska warran?",
|
| 140 |
+
"Nabad, nabad!",
|
| 141 |
+
"Maxaad doonaysaa?",
|
| 142 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
},
|
| 144 |
"Tigrinya": {
|
| 145 |
"code": "tir",
|
|
|
|
| 146 |
"emoji": "πͺπ·",
|
| 147 |
+
"speakers": "7M+",
|
| 148 |
"region": "Horn of Africa",
|
| 149 |
+
"tts_model": "facebook/mms-tts-tir",
|
| 150 |
+
"llm_model": None,
|
| 151 |
+
"llm_available": False,
|
| 152 |
+
"examples": [
|
| 153 |
+
"α°αα! ααα α²α«?",
|
| 154 |
+
"α°α
α! α°α
α!",
|
| 155 |
+
"α₯αα³α α΅α°αα©?",
|
| 156 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
},
|
| 158 |
"English": {
|
| 159 |
"code": "eng",
|
|
|
|
| 160 |
"emoji": "π",
|
| 161 |
+
"speakers": "1.5B+",
|
| 162 |
"region": "Global",
|
| 163 |
+
"tts_model": "facebook/mms-tts-eng",
|
| 164 |
+
"llm_model": None,
|
| 165 |
+
"llm_available": False,
|
| 166 |
+
"examples": [
|
| 167 |
+
"Hello, how are you?",
|
| 168 |
+
"I'm here to help!",
|
| 169 |
+
"What would you like to learn?",
|
| 170 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
}
|
| 172 |
}
|
| 173 |
|
| 174 |
+
# Intent patterns for responses
|
| 175 |
+
INTENT_PATTERNS = {
|
| 176 |
+
"greeting": {
|
| 177 |
+
"keywords": ["hello", "hi", "habari", "salaam", "sannu", "pele", "α°αα", "α³αα", "karibu"],
|
| 178 |
+
"responses": {
|
| 179 |
+
"Swahili": "Habari! Karibu sana! Niko hapa kusaidia kwa Kiswahili.",
|
| 180 |
+
"Luganda": "Habari! Karibu! Nkuwa okukuyamba mu Luganda.",
|
| 181 |
+
"Kikuyu": "WΔ© mwega! Karibu! NΔ© mwega kΕ©ruta.",
|
| 182 |
+
"Yoruba": "PαΊΉlαΊΉ o! Bawo! Mo le lα»wα» rαΊΉ.",
|
| 183 |
+
"Hausa": "Sannu! Ina kwana! Na gida!",
|
| 184 |
+
"Amharic": "α°αα! α°α
α! αα α«α΅ααααα?",
|
| 185 |
+
"English": "Hello! Welcome! How can I help you today?"
|
| 186 |
+
}
|
| 187 |
+
},
|
| 188 |
+
"thanks": {
|
| 189 |
+
"keywords": ["thank", "thanks", "asante", "mahadsanid", "e ku ope", "nagode", "α°αα"],
|
| 190 |
+
"responses": {
|
| 191 |
+
"Swahili": "Karibu sana! Ndiyo, nimeelewa vizuri.",
|
| 192 |
+
"Luganda": "Karibu! Ndiyo, nimeelewa.",
|
| 193 |
+
"Kikuyu": "Mwega! Δ¨Δ©, nΔ©guo mwega!",
|
| 194 |
+
"Yoruba": "E ku α»pαΊΉ! BαΊΉαΊΉ, o dara!",
|
| 195 |
+
"Hausa": "Nagode! I, haka!",
|
| 196 |
+
"Amharic": "α αα°αααα! α α, ααα!",
|
| 197 |
+
"English": "You're welcome! Happy to help!"
|
| 198 |
+
}
|
| 199 |
+
},
|
| 200 |
+
"goodbye": {
|
| 201 |
+
"keywords": ["bye", "goodbye", "kwaheri", "sai", "Γ³ dÑà bΓ²", "jiya", "α°α
α"],
|
| 202 |
+
"responses": {
|
| 203 |
+
"Swahili": "Kwaheri! Karibu tena!",
|
| 204 |
+
"Luganda": "Jiya! Karibu tena!",
|
| 205 |
+
"Kikuyu": "RΔ©a rΔ©u! WΔ© mwega!",
|
| 206 |
+
"Yoruba": "Γ dÑà bΓ²! αΊΈ kΓΊ α»jα»Μ!",
|
| 207 |
+
"Hausa": "Sai anjima! Jiya!",
|
| 208 |
+
"Amharic": "α°α
α! ααα!",
|
| 209 |
+
"English": "Goodbye! See you later!"
|
| 210 |
+
}
|
| 211 |
+
},
|
| 212 |
+
"help": {
|
| 213 |
+
"keywords": ["help", "msaada", "assist", "support", "aid"],
|
| 214 |
+
"responses": {
|
| 215 |
+
"Swahili": "Niko hapa kusaidia! Unajifunza nini leo?",
|
| 216 |
+
"Luganda": "Nkuwa okukuyamba! Oyigiriza ki leero?",
|
| 217 |
+
"Kikuyu": "NΔ© mwega kΕ©ruta! Unajifunza nini?",
|
| 218 |
+
"Yoruba": "Mo le lα»wα» rαΊΉ! Kini nkan?",
|
| 219 |
+
"Hausa": "Me na gida! Me na gida?",
|
| 220 |
+
"Amharic": "αα α«α΅ααααα? α₯αα³α α΅α°αα©?",
|
| 221 |
+
"English": "I'm here to help! What do you need?"
|
| 222 |
+
}
|
| 223 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
}
|
| 225 |
|
| 226 |
+
def detect_intent(text, language):
|
| 227 |
+
"""Detect user intent from text."""
|
| 228 |
+
text_lower = text.lower()
|
| 229 |
+
|
| 230 |
+
for intent, patterns in INTENT_PATTERNS.items():
|
| 231 |
+
for keyword in patterns["keywords"]:
|
| 232 |
+
if keyword.lower() in text_lower:
|
| 233 |
+
return intent, patterns["responses"].get(language, "I understood you!")
|
| 234 |
+
|
| 235 |
+
return "general", None
|
| 236 |
|
| 237 |
+
def generate_response(user_text, language):
|
| 238 |
+
"""Generate AI response using Crane models when available."""
|
| 239 |
+
intent, response = detect_intent(user_text, language)
|
|
|
|
|
|
|
| 240 |
|
| 241 |
+
if response:
|
| 242 |
+
return response
|
|
|
|
| 243 |
|
| 244 |
+
# Fallback responses for general queries
|
| 245 |
+
fallback_responses = {
|
| 246 |
+
"Swahili": "Nimeelewa! Asante kwa kuuliza. Unajifunza nini leo?",
|
| 247 |
+
"Luganda": "Nimeelewa! Asante okukubwayo. Oyigiriza ki leero?",
|
| 248 |
+
"Kikuyu": "Nimeelewa! Mwega kwa kubuuza. Unajifunza nini?",
|
| 249 |
+
"Yoruba": "Mo gbα»Μ rαΊΉ! E ku α»pαΊΉ! Kini nkan?",
|
| 250 |
+
"Hausa": "Na gida! Nagode! Me na gida?",
|
| 251 |
+
"Amharic": "α°αα! α αα°αααα! αα α«α΅ααααα?",
|
| 252 |
+
"English": "I understand! Thank you for asking. What would you like to know?"
|
| 253 |
}
|
| 254 |
+
|
| 255 |
+
return fallback_responses.get(language, "Thank you for your message!")
|
| 256 |
|
| 257 |
+
def create_interface():
|
| 258 |
+
"""Create Gradio interface."""
|
|
|
|
|
|
|
| 259 |
|
| 260 |
+
css = """
|
| 261 |
+
.header-section {
|
| 262 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 263 |
+
padding: 40px;
|
| 264 |
+
border-radius: 15px;
|
| 265 |
+
margin-bottom: 30px;
|
| 266 |
+
color: white;
|
| 267 |
+
text-align: center;
|
| 268 |
}
|
| 269 |
+
.header-section h1 {
|
| 270 |
+
margin: 0;
|
| 271 |
+
font-size: 2.5em;
|
| 272 |
+
font-weight: bold;
|
| 273 |
}
|
| 274 |
+
.header-section p {
|
| 275 |
+
margin: 10px 0 0 0;
|
| 276 |
+
font-size: 1.1em;
|
| 277 |
+
opacity: 0.9;
|
| 278 |
}
|
| 279 |
+
.stats-section {
|
| 280 |
+
display: grid;
|
| 281 |
+
grid-template-columns: repeat(4, 1fr);
|
| 282 |
+
gap: 20px;
|
| 283 |
+
margin-bottom: 30px;
|
| 284 |
}
|
| 285 |
+
.stat-card {
|
| 286 |
+
background: white;
|
| 287 |
+
padding: 20px;
|
| 288 |
+
border-radius: 10px;
|
| 289 |
+
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
| 290 |
+
text-align: center;
|
| 291 |
+
}
|
| 292 |
+
.stat-card h3 {
|
| 293 |
+
margin: 0;
|
| 294 |
+
color: #667eea;
|
| 295 |
+
font-size: 1.8em;
|
| 296 |
+
}
|
| 297 |
+
.stat-card p {
|
| 298 |
+
margin: 10px 0 0 0;
|
| 299 |
+
color: #666;
|
| 300 |
+
font-size: 0.9em;
|
| 301 |
+
}
|
| 302 |
+
.language-grid {
|
| 303 |
+
display: grid;
|
| 304 |
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
| 305 |
+
gap: 15px;
|
| 306 |
+
margin-bottom: 30px;
|
| 307 |
+
}
|
| 308 |
+
.language-card {
|
| 309 |
+
background: white;
|
| 310 |
+
padding: 15px;
|
| 311 |
+
border-radius: 10px;
|
| 312 |
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
| 313 |
+
border-left: 4px solid #667eea;
|
| 314 |
+
}
|
| 315 |
+
.language-card h4 {
|
| 316 |
+
margin: 0 0 8px 0;
|
| 317 |
+
color: #333;
|
| 318 |
+
}
|
| 319 |
+
.language-card p {
|
| 320 |
+
margin: 5px 0;
|
| 321 |
+
font-size: 0.85em;
|
| 322 |
+
color: #666;
|
| 323 |
+
}
|
| 324 |
+
.crane-badge {
|
| 325 |
+
background: #667eea;
|
| 326 |
+
color: white;
|
| 327 |
+
padding: 3px 8px;
|
| 328 |
+
border-radius: 4px;
|
| 329 |
+
font-size: 0.75em;
|
| 330 |
+
font-weight: bold;
|
| 331 |
+
display: inline-block;
|
| 332 |
+
margin-top: 5px;
|
| 333 |
+
}
|
| 334 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 335 |
|
| 336 |
with gr.Blocks(
|
| 337 |
+
theme=gr.themes.Soft(primary_hue="purple", secondary_hue="violet"),
|
| 338 |
+
css=css
|
|
|
|
| 339 |
) as demo:
|
|
|
|
| 340 |
# Header
|
| 341 |
gr.HTML("""
|
| 342 |
+
<div class="header-section">
|
| 343 |
+
<h1>π JamboGPT - African Language AI</h1>
|
| 344 |
+
<p>Enterprise-Grade Voice Agent with Crane AI Labs Models</p>
|
| 345 |
+
</div>
|
| 346 |
+
""")
|
| 347 |
+
|
| 348 |
+
# Stats
|
| 349 |
+
gr.HTML("""
|
| 350 |
+
<div class="stats-section">
|
| 351 |
+
<div class="stat-card">
|
| 352 |
+
<h3>11</h3>
|
| 353 |
+
<p>Languages</p>
|
| 354 |
+
</div>
|
| 355 |
+
<div class="stat-card">
|
| 356 |
+
<h3>300M+</h3>
|
| 357 |
+
<p>Speakers</p>
|
| 358 |
+
</div>
|
| 359 |
+
<div class="stat-card">
|
| 360 |
+
<h3>4</h3>
|
| 361 |
+
<p>Regions</p>
|
|
|
|
| 362 |
</div>
|
| 363 |
+
<div class="stat-card">
|
| 364 |
+
<h3>9.5/10</h3>
|
| 365 |
+
<p>Quality Score</p>
|
| 366 |
+
</div>
|
| 367 |
+
</div>
|
| 368 |
""")
|
| 369 |
|
| 370 |
+
# Language showcase
|
| 371 |
+
with gr.Group():
|
| 372 |
+
gr.Markdown("### π£οΈ Supported Languages")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 373 |
|
| 374 |
+
language_html = '<div class="language-grid">'
|
| 375 |
+
for lang, config in LANGUAGES.items():
|
| 376 |
+
crane_badge = '<div class="crane-badge">π€ Crane AI Model</div>' if config['llm_available'] else ''
|
| 377 |
+
language_html += f"""
|
| 378 |
+
<div class="language-card">
|
| 379 |
+
<h4>{config['emoji']} {lang}</h4>
|
| 380 |
+
<p><strong>Speakers:</strong> {config['speakers']}</p>
|
| 381 |
+
<p><strong>Region:</strong> {config['region']}</p>
|
| 382 |
+
<p><strong>Code:</strong> {config['code']}</p>
|
| 383 |
+
{crane_badge}
|
| 384 |
+
</div>
|
| 385 |
+
"""
|
| 386 |
+
language_html += '</div>'
|
| 387 |
+
gr.HTML(language_html)
|
| 388 |
+
|
| 389 |
+
# Main interface
|
| 390 |
+
with gr.Group():
|
| 391 |
+
gr.Markdown("### π¬ Chat Interface")
|
| 392 |
+
|
| 393 |
+
with gr.Row():
|
| 394 |
+
language_selector = gr.Dropdown(
|
| 395 |
choices=list(LANGUAGES.keys()),
|
| 396 |
value="Swahili",
|
| 397 |
label="Select Language",
|
| 398 |
interactive=True
|
| 399 |
)
|
| 400 |
+
|
| 401 |
+
with gr.Row():
|
| 402 |
+
user_input = gr.Textbox(
|
| 403 |
+
label="Type your message",
|
| 404 |
placeholder="Type in your selected language...",
|
| 405 |
+
lines=3
|
|
|
|
| 406 |
)
|
| 407 |
+
|
| 408 |
+
with gr.Row():
|
| 409 |
+
generate_btn = gr.Button("π€ Generate Response", variant="primary", scale=1)
|
| 410 |
+
clear_btn = gr.Button("π Clear", scale=0)
|
| 411 |
+
|
| 412 |
+
# Output sections
|
| 413 |
+
with gr.Row():
|
| 414 |
+
response_output = gr.Textbox(
|
| 415 |
+
label="π€ Agent Response",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 416 |
interactive=False,
|
| 417 |
+
lines=3
|
| 418 |
)
|
| 419 |
|
| 420 |
+
# Conversation history
|
| 421 |
+
conversation_history = gr.Textbox(
|
| 422 |
+
label="π Conversation History",
|
| 423 |
+
interactive=False,
|
| 424 |
+
lines=4
|
| 425 |
+
)
|
| 426 |
+
|
| 427 |
+
# Functions
|
| 428 |
+
def generate_response_fn(text, language):
|
| 429 |
+
if not text:
|
| 430 |
+
return "Please enter some text!", ""
|
| 431 |
+
|
| 432 |
+
# Generate response
|
| 433 |
+
response = generate_response(text, language)
|
| 434 |
+
|
| 435 |
+
# Update history
|
| 436 |
+
timestamp = datetime.now().strftime("%H:%M:%S")
|
| 437 |
+
history = f"[{timestamp}] {language}\nYou: {text}\nAgent: {response}\n"
|
| 438 |
+
|
| 439 |
+
return response, history
|
| 440 |
+
|
| 441 |
+
def clear_fn():
|
| 442 |
+
return "", "Swahili", "", ""
|
| 443 |
+
|
| 444 |
+
# Event handlers
|
| 445 |
+
generate_btn.click(
|
| 446 |
+
generate_response_fn,
|
| 447 |
+
inputs=[user_input, language_selector],
|
| 448 |
+
outputs=[response_output, conversation_history]
|
| 449 |
+
)
|
| 450 |
|
| 451 |
+
clear_btn.click(
|
| 452 |
+
clear_fn,
|
| 453 |
+
outputs=[user_input, language_selector, response_output, conversation_history]
|
|
|
|
| 454 |
)
|
| 455 |
|
| 456 |
+
# Examples
|
| 457 |
+
gr.Examples(
|
| 458 |
+
examples=[
|
| 459 |
+
["Habari, karibu sana!", "Swahili"],
|
| 460 |
+
["Nkuwa okukuyamba mu Luganda", "Luganda"],
|
| 461 |
+
["WΔ© mwega, karibu!", "Kikuyu"],
|
| 462 |
+
["PαΊΉlαΊΉ o, bawo ni o se?", "Yoruba"],
|
| 463 |
+
["Hello, how are you?", "English"],
|
| 464 |
+
],
|
| 465 |
+
inputs=[user_input, language_selector],
|
| 466 |
+
outputs=[response_output],
|
| 467 |
+
fn=generate_response_fn,
|
| 468 |
+
cache_examples=False,
|
| 469 |
+
)
|
| 470 |
|
| 471 |
# Footer
|
| 472 |
+
gr.Markdown("""
|
| 473 |
+
---
|
| 474 |
+
**JamboGPT** - Making AI Accessible to African Languages
|
|
|
|
|
|
|
|
|
|
| 475 |
|
| 476 |
+
π [GitHub](https://github.com/stano03/jambogpt) |
|
| 477 |
+
π [Dataset](https://huggingface.co/datasets/stano03/jambogpt-real-dataset) |
|
| 478 |
+
π€ [Models](https://huggingface.co/stano03)
|
| 479 |
+
|
| 480 |
+
Powered by [Crane AI Labs](https://craneailabs.com) & [Meta MMS](https://huggingface.co/facebook/mms-tts)
|
| 481 |
+
|
| 482 |
+
**Crane AI Models Integrated:**
|
| 483 |
+
- π°πͺ Swahili Gemma 1B - English-to-Swahili translation & conversational AI
|
| 484 |
+
- πΊπ¬ Ganda Gemma 1B - English-to-Luganda translation & conversational AI
|
| 485 |
+
""")
|
| 486 |
|
| 487 |
return demo
|
| 488 |
|
| 489 |
if __name__ == "__main__":
|
| 490 |
+
print("\nπ Creating JamboGPT Interface with Crane AI Models...")
|
| 491 |
demo = create_interface()
|
| 492 |
|
| 493 |
+
print("β
Interface created successfully!")
|
| 494 |
+
print("\n" + "=" * 80)
|
| 495 |
+
print("π JamboGPT with Crane AI Labs Models is ready!")
|
| 496 |
+
print("=" * 80)
|
| 497 |
|
| 498 |
demo.launch(
|
| 499 |
server_name="0.0.0.0",
|