Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -209,6 +209,81 @@ def t2tstream(text):
|
|
| 209 |
def t2s(text,name_model):
|
| 210 |
return genrate_speech(text,name_model)
|
| 211 |
#return get_answer_ai(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
import gradio as gr
|
| 213 |
import os
|
| 214 |
import plotly.express as px
|
|
@@ -255,7 +330,40 @@ fig = random_plot()
|
|
| 255 |
|
| 256 |
|
| 257 |
with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
| 258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
with gr.Tab("ChatBot "):
|
| 260 |
chatbot = gr.Chatbot(
|
| 261 |
elem_id="chatbot",
|
|
|
|
| 209 |
def t2s(text,name_model):
|
| 210 |
return genrate_speech(text,name_model)
|
| 211 |
#return get_answer_ai(text)
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
def home_page():
|
| 215 |
+
return """
|
| 216 |
+
<div class="px-4 py-5 my-5 text-center">
|
| 217 |
+
<img class="d-block mx-auto mb-4" src="/docs/5.0/assets/brand/bootstrap-logo.svg" alt="" width="72" height="57">
|
| 218 |
+
<h1 class="display-5 fw-bold">مرحباً بك في Wasm-Speeker</h1>
|
| 219 |
+
<div class="col-lg-6 mx-auto">
|
| 220 |
+
<p class="lead mb-4">
|
| 221 |
+
Wasm-Speeker هو إطار متقدم يعتمد على تقنيات الذكاء الاصطناعي لتوليد الكلام من النصوص.
|
| 222 |
+
تعتمد جميع النماذج على بنية VITS، التي تتيح توليد موجات صوتية واقعية بناءً على المدخلات النصية.
|
| 223 |
+
النماذج تحتوي على محولات لتحليل النص وتوليد الكلام بناءً على خصائص الصوت المحلية لكل لهجة.
|
| 224 |
+
</p>
|
| 225 |
+
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
|
| 226 |
+
<button type="button" class="btn btn-primary btn-lg px-4 gap-3">Primary button</button>
|
| 227 |
+
<button type="button" class="btn btn-outline-secondary btn-lg px-4">Secondary</button>
|
| 228 |
+
</div>
|
| 229 |
+
</div>
|
| 230 |
+
</div>
|
| 231 |
+
<div style='text-align: right; direction: rtl;'>
|
| 232 |
+
<h1>مرحباً بك في Wasm-Speeker</h1>
|
| 233 |
+
<p>Wasm-Speeker هو إطار متقدم يعتمد على تقنيات الذكاء الاصطناعي لتوليد الكلام من النصوص.</p>
|
| 234 |
+
<p>تعتمد جميع النماذج على بنية VITS، التي تتيح توليد موجات صوتية واقعية بناءً على المدخلات النصية.</p>
|
| 235 |
+
<p>النماذج تحتوي على محولات لتحليل النص وتوليد الكلام بناءً على خصائص الصوت المحلية لكل لهجة.</p>
|
| 236 |
+
<h2>مميزات Wasm-Speeker:</h2>
|
| 237 |
+
<ul>
|
| 238 |
+
<li>التخصص في اللهجة السعودية.</li>
|
| 239 |
+
<li>سهولة التدريب.</li>
|
| 240 |
+
<li>الأداء المتوازن.</li>
|
| 241 |
+
<li>الاستخدام الفعال للموارد.</li>
|
| 242 |
+
<li>الشعبية والانتشار.</li>
|
| 243 |
+
<li>حجم النموذج: 36.3 مليون باراميتر.</li>
|
| 244 |
+
</ul>
|
| 245 |
+
</div>
|
| 246 |
+
<div class="container col-xxl-8 px-4 py-5">
|
| 247 |
+
<div class="row flex-lg-row-reverse align-items-center g-5 py-5">
|
| 248 |
+
<div class="col-10 col-sm-8 col-lg-6">
|
| 249 |
+
<img src="bootstrap-themes.png" class="d-block mx-lg-auto img-fluid" alt="Bootstrap Themes" width="700" height="500" loading="lazy">
|
| 250 |
+
</div>
|
| 251 |
+
<div class="col-lg-6">
|
| 252 |
+
<h1 class="display-5 fw-bold lh-1 mb-3">Responsive left-aligned hero with image</h1>
|
| 253 |
+
<p class="lead">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
|
| 254 |
+
<div class="d-grid gap-2 d-md-flex justify-content-md-start">
|
| 255 |
+
<button type="button" class="btn btn-primary btn-lg px-4 me-md-2">Primary</button>
|
| 256 |
+
<button type="button" class="btn btn-outline-secondary btn-lg px-4">Default</button>
|
| 257 |
+
</div>
|
| 258 |
+
</div>
|
| 259 |
+
</div>
|
| 260 |
+
</div>
|
| 261 |
+
<div class="row p-4 pb-0 pe-lg-0 pt-lg-5 align-items-center rounded-3 border shadow-lg">
|
| 262 |
+
<div class="col-lg-7 p-3 p-lg-5 pt-lg-3">
|
| 263 |
+
<h1 class="display-4 fw-bold lh-1">Border hero with cropped image and shadows</h1>
|
| 264 |
+
<p class="lead">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
|
| 265 |
+
<div class="d-grid gap-2 d-md-flex justify-content-md-start mb-4 mb-lg-3">
|
| 266 |
+
<button type="button" class="btn btn-primary btn-lg px-4 me-md-2 fw-bold">Primary</button>
|
| 267 |
+
<button type="button" class="btn btn-outline-secondary btn-lg px-4">Default</button>
|
| 268 |
+
</div>
|
| 269 |
+
</div>
|
| 270 |
+
<div class="col-lg-4 offset-lg-1 p-0 overflow-hidden shadow-lg">
|
| 271 |
+
<img class="rounded-lg-3" src="bootstrap-docs.png" alt="" width="720">
|
| 272 |
+
</div>
|
| 273 |
+
</div>
|
| 274 |
+
<div class="bg-dark text-secondary px-4 py-5 text-center">
|
| 275 |
+
<div >
|
| 276 |
+
<h1 class="display-5 fw-bold text-white">Dark mode hero</h1>
|
| 277 |
+
<div class="col-lg-6 mx-auto">
|
| 278 |
+
<p class="fs-5 mb-4">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
|
| 279 |
+
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
|
| 280 |
+
<button type="button" class="btn btn-outline-info btn-lg px-4 me-sm-3 fw-bold">Custom button</button>
|
| 281 |
+
<button type="button" class="btn btn-outline-light btn-lg px-4">Secondary</button>
|
| 282 |
+
</div>
|
| 283 |
+
</div>
|
| 284 |
+
</div>
|
| 285 |
+
</div>
|
| 286 |
+
"""
|
| 287 |
import gradio as gr
|
| 288 |
import os
|
| 289 |
import plotly.express as px
|
|
|
|
| 330 |
|
| 331 |
|
| 332 |
with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
| 333 |
+
gr.HTML("""
|
| 334 |
+
<head>
|
| 335 |
+
<!-- Required meta tags -->
|
| 336 |
+
<meta charset="utf-8">
|
| 337 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 338 |
+
|
| 339 |
+
<!-- Bootstrap CSS -->
|
| 340 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
|
| 341 |
+
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
| 342 |
+
|
| 343 |
+
<title>Wasm-Speeker</title>
|
| 344 |
+
</head>
|
| 345 |
+
""")
|
| 346 |
+
|
| 347 |
+
# العنوان الرئيسي
|
| 348 |
+
gr.Markdown("# Wasm-Speeker: إطار الذكاء الاصطناعي لتوليد الكلام")
|
| 349 |
+
|
| 350 |
+
# عرض الصورة الترحيبية
|
| 351 |
+
gr.Image("/content/9588e6d4-9959-4cfc-9697-fc9b996fcd97.jpeg", label="Wasm-Speeker")
|
| 352 |
+
|
| 353 |
+
# إضافة CSS لجعل التبويبات RTL
|
| 354 |
+
gr.HTML("""
|
| 355 |
+
<style>
|
| 356 |
+
.gradio-tabs {
|
| 357 |
+
direction: rtl;
|
| 358 |
+
}
|
| 359 |
+
</style>
|
| 360 |
+
""")
|
| 361 |
+
|
| 362 |
+
# تبويبات الصفحات
|
| 363 |
+
with gr.Tabs():
|
| 364 |
+
# صفحة رئيسية
|
| 365 |
+
with gr.TabItem("الصفحة الرئيسية"):
|
| 366 |
+
gr.HTML(home_page())
|
| 367 |
with gr.Tab("ChatBot "):
|
| 368 |
chatbot = gr.Chatbot(
|
| 369 |
elem_id="chatbot",
|