Spaces:
Running
on
Zero
Running
on
Zero
| import gradio as gr | |
| import torch | |
| from transformers import AutoProcessor, CsmForConditionalGeneration | |
| import librosa | |
| import numpy as np | |
| import soundfile as sf | |
| import tempfile | |
| import os | |
| import re | |
| import spaces | |
| from csm1b_dv import ( | |
| get_csm1b_tab, load_model, get_current_speaker_prompts, | |
| get_model_info, get_speaker_choices, load_audio_file, | |
| generate_simple_audio, generate_context_audio, trim_silence, | |
| split_sentences, extract_audio_output, generate_conversation, | |
| change_model_and_update_ui | |
| ) | |
| from dia_1_6B_dv import get_dia_1_6B_tab | |
| with gr.Blocks( | |
| title="Dhivehi (Thaana) Text-to-Speech", | |
| css=""" | |
| .dhivehi-text textarea { | |
| font-size: 18px !important; | |
| font-family: 'MV_Faseyha', 'Faruma', 'A_Faruma', monospace !important; | |
| line-height: 1.8 !important; | |
| direction: rtl !important; | |
| text-align: right !important; | |
| } | |
| .dhivehi-text input { | |
| font-size: 18px !important; | |
| font-family: 'MV_Faseyha', 'Faruma', 'A_Faruma', monospace !important; | |
| direction: rtl !important; | |
| text-align: right !important; | |
| } | |
| """ | |
| ) as app: | |
| get_csm1b_tab() | |
| get_dia_1_6B_tab() | |
| if __name__ == "__main__": | |
| app.launch(share=False) |