import csv import gradio as gr import os import time import os import pandas as pd app = None os.environ['GRADIO_ANALYTICS_ENABLED'] = 'False' CURR_BASE_DIR = os.getcwd() BASE_AUDIOS_DIR = os.path.join(os.getcwd(), "results") BASE_VIDEO_DIR = BASE_AUDIOS_DIR should_stop = False current_process = None if not os.path.exists(BASE_AUDIOS_DIR): os.makedirs(BASE_AUDIOS_DIR) custom_css = """ .gradio-container{ background-color: unset; } input, textarea { font-family: 'Noto Naskh Arabic', 'Arial', sans-serif !important; } .large_text input{ font-size:20px !important } .tab-container button{ font-weight: bold !important; } .tabs{ gap:0px !important; } .tabitem{ padding:0px !important; } button.secondary:hover{ background-color:steelblue !important; color:white; } .tab-container button { font-size:20px !important; } .tabitem{ padding-top:0px !important; } #tool-header{ padding:20px 0px 20px 0px !important; } #tool-header h1{ display: flex; align-items: center; } #tool-header img{ width: 80px; display: inline-block; margin-right: 10px; border-radius: 5px; } """ def natural_sort_key(file_name): if ".DS_Store" in file_name: return 0 return int(file_name.split("_")[1]) def get_data(folders_list, language="msa"): results_csv_df = pd.read_csv(f"{CURR_BASE_DIR}/results/{language}/Ar_{language}_TTS_benchmark.csv") data_map = {} try: for folder_name in folders_list: full_audio_folder_path = os.path.join(BASE_AUDIOS_DIR,language ,folder_name) if not os.path.exists(full_audio_folder_path): print(f"Folder not found: {full_audio_folder_path}") continue if folder_name not in data_map: data_map[folder_name] = [] ##get all wavs and mp3s from full_audio_folder_path for file in sorted(os.listdir(full_audio_folder_path), key=natural_sort_key): if ".DS_Store" in file: continue if file.endswith(".wav") or file.endswith(".mp3"): abs_path = os.path.join(full_audio_folder_path, file) data_map[folder_name].append(abs_path) final_df = pd.DataFrame(columns=["Text"].extend(folders_list)) final_df["Text"] = results_csv_df["Text"] cache_random_hash = str(time.time()) for folder_name in data_map: folder_files_list = data_map[folder_name] formatted_column = pd.Series(folder_files_list).apply( lambda file_path: f'' ) ## append column to dataframe final_df[folder_name] = formatted_column return final_df except Exception as e: print(f"An error occurred: {e}") gr.Warning(f"An error occurred: {e}") raise e with gr.Blocks(css=custom_css) as app: gr.HTML( f"""

Open-source Arabic TTS Benchmark


This benchmark represents a foundational step by SILMA.AI towards establishing a high-quality benchmark for open-source Arabic TTS models. We have found that standard quantitative metrics (such as WER, CER, SIM, and UTMOS) are often insufficient for accurately capturing the nuances of Arabic speech. Consequently, for this release we have prioritized direct auditory assessment, allowing listeners to evaluate the naturalness and quality of the models themselves. More advanced releases will follow as we develop the necessary technology. You can also check our Commercial Arabic TTS Benchmark

Note: To make the benchmark more manageable, we have excluded models that require Tashkeel, as well as those based on old architectures

Habibi-TTS - XTTS-v2 - EGTTS-v0.1 - Chatterbox-Egyptian """) with gr.Column(): gr.Markdown("Other models:") gr.Markdown(""" - Arabic-F5-TTS-v2 - Arabic-TTS-Spark - Spark_TTS_Arabic """) def main(): global app print("Starting app...") app.queue().launch(favicon_path="images/silma-favicon.png", allowed_paths=[CURR_BASE_DIR+"/images/",CURR_BASE_DIR+"/results/"]) if __name__ == "__main__": main()