Package: silero
Silero ModelsInstallation and BasicsSpeech-To-TextDependenciesPyTorchONNXTensorFlowText-To-SpeechModels and SpeakersDependenciesPyTorchStandalone UseSSMLIndic languagesText-EnhancementDependenciesStandalone UseFAQWikiPerformance and QualityAdding new LanguagesContactGet in TouchCommercial InquiriesCitationsFurther readingEnglishChineseRussianDonationsSilero ModelsSilero Models: pre-trained enterprise-grade STT / TTS models and benchmarks.Enterprise-grade STT made refreshingly simple (seriously, seebenchmarks).
We provide quality comparable to Google's STT (and sometimes even better) and we are not Google.As a bonus:No Kaldi;No compilation;No 20-step instructions;Also we have published TTS models that satisfy the following criteria:One-line usage;A large library of voices;A fully end-to-end pipeline;Naturally sounding speech;No GPU or training required;Minimalism and lack of dependencies;Faster than real-time on one CPU thread (!!!);Support for 16kHz and 8kHz out of the box;Also we have published a model for text repunctuation and recapitalization that:Inserts capital letters and basic punctuation marks (dot, comma, hyphen, question mark, exclamation mark, dash for Russian);Works for 4 languages (Russian, English, German, Spanish) and can be extended;By design is domain agnostic and is not based on any hard-coded rules;Has non-trivial metrics and succeeds in the task of improving text readability;Installation and BasicsYou can basically use our models in 3 flavours:Via PyTorch Hub:torch.hub.load();Via pip:pip install sileroand thenimport silero;Via caching the required models and utils manually and modifying if necessary;Models are downloaded on demand both by pip and PyTorch Hub. If you need caching, do it manually or via invoking a necessary model once (it will be downloaded to a cache folder). Please see thesedocsfor more information.PyTorch Hub and pip package are based on the same code. Hence all examples, historically based ontorch.hub.loadcan be used with a pip-package via this basic change:# beforetorch.hub.load(repo_or_dir='snakers4/silero-models',model='silero_stt',# or silero_tts or silero_te**kwargs)# afterfromsileroimportsilero_stt,silero_tts,silero_tesilero_stt(**kwargs)Speech-To-TextAll of the provided models are listed in themodels.ymlfile.
Any meta-data and newer versions will be added there.Currently we provide the following checkpoints:PyTorchONNXQuantizationQualityColabEnglish (en_v6):heavy_check_mark::heavy_check_mark::heavy_check_mark:linkEnglish (en_v5):heavy_check_mark::heavy_check_mark::heavy_check_mark:linkGerman (de_v4):heavy_check_mark::heavy_check_mark::hourglass:linkEnglish (en_v3):heavy_check_mark::heavy_check_mark::heavy_check_mark:linkGerman (de_v3):heavy_check_mark::hourglass::hourglass:linkGerman (de_v1):heavy_check_mark::heavy_check_mark::hourglass:linkSpanish (es_v1):heavy_check_mark::heavy_check_mark::hourglass:linkUkrainian (ua_v3):heavy_check_mark::heavy_check_mark::heavy_check_mark:N/AModel flavours:jitjitjitjitjit_qjit_qonnxonnxonnxonnxxsmallsmalllargexlargexsmallsmallxsmallsmalllargexlargeEnglishen_v6:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:Englishen_v5:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:Englishen_v4_0:heavy_check_mark::heavy_check_mark:Englishen_v3:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:Germande_v4:heavy_check_mark::heavy_check_mark:Germande_v3:heavy_check_mark:Germande_v1:heavy_check_mark::heavy_check_mark:Spanishes_v1:heavy_check_mark::heavy_check_mark:Ukrainianua_v3:heavy_check_mark::heavy_check_mark::heavy_check_mark:DependenciesAll examples:torch, 1.8+ (used to clone the repo in tf and onnx examples), breaking changes for version older than 1.6torchaudio, latest version bound to PyTorch should workomegaconf, latest just should workAdditional for ONNX examples:onnx, latest just should workonnxruntime, latest just should workAdditional for TensorFlow examples:tensorflow, latest just should worktensorflow_hub, latest just should workPlease see the provided Colab for details for each example below. All examples are maintained to work with the latest major packaged versions of the installed libraries.PyTorchimporttorchimportzipfileimporttorchaudiofromglobimportglobdevice=torch.device('cpu')# gpu also works, but our models are fast enough for CPUmodel,decoder,utils=torch.hub.load(repo_or_dir='snakers4/silero-models',model='silero_stt',language='en',# also available 'de', 'es'device=device)(read_batch,split_into_batches,read_audio,prepare_model_input)=utils# see function signature for details# download a single file, any format compatible with TorchAudiotorch.hub.download_url_to_file('https://opus-codec.org/static/examples/samples/speech_orig.wav',dst='speech_orig.wav',progress=True)test_files=glob('speech_orig.wav')batches=split_into_batches(test_files,batch_size=10)input=prepare_model_input(read_batch(batches[0]),device=device)output=model(input)forexampleinoutput:print(decoder(example.cpu()))ONNXYou can run our model everywhere, where you can import the ONNX model or run ONNX runtime.importonnximporttorchimportonnxruntimefromomegaconfimportOmegaConflanguage='en'# also available 'de', 'es'# load provided utils_,decoder,utils=torch.hub.load(repo_or_dir='snakers4/silero-models',model='silero_stt',language=language)(read_batch,split_into_batches,read_audio,prepare_model_input)=utils# see available modelstorch.hub.download_url_to_file('https://raw.githubusercontent.com/snakers4/silero-models/master/models.yml','models.yml')models=OmegaConf.load('models.yml')available_languages=list(models.stt_models.keys())assertlanguageinavailable_languages# load the actual ONNX modeltorch.hub.download_url_to_file(models.stt_models.en.latest.onnx,'model.onnx',progress=True)onnx_model=onnx.load('model.onnx')onnx.checker.check_model(onnx_model)ort_session=onnxruntime.InferenceSession('model.onnx')# download a single file, any format compatible with TorchAudiotorch.hub.download_url_to_file('https://opus-codec.org/static/examples/samples/speech_orig.wav',dst='speech_orig.wav',progress=True)test_files=['speech_orig.wav']batches=split_into_batches(test_files,batch_size=10)input=prepare_model_input(read_batch(batches[0]))# actual onnx inference and decodingonnx_input=input.detach().cpu().numpy()ort_inputs={'input':onnx_input}ort_outs=ort_session.run(None,ort_inputs)decoded=decoder(torch.Tensor(ort_outs[0])[0])print(decoded)TensorFlowSavedModel exampleimportosimporttorchimportsubprocessimporttensorflowastfimporttensorflow_hubastf_hubfromomegaconfimportOmegaConflanguage='en'# also available 'de', 'es'# load provided utils using torch.hub for brevity_,decoder,utils=torch.hub.load(repo_or_dir='snakers4/silero-models',model='silero_stt',language=language)(read_batch,split_into_batches,read_audio,prepare_model_input)=utils# see available modelstorch.hub.download_url_to_file('https://raw.githubusercontent.com/snakers4/silero-models/master/models.yml','models.yml')models=OmegaConf.load('models.yml')available_languages=list(models.stt_models.keys())assertlanguageinavailable_languages# load the actual tf modeltorch.hub.download_url_to_file(models.stt_models.en.latest.tf,'tf_model.tar.gz')subprocess.run('rm -rf tf_model && mkdir tf_model && tar xzfv tf_model.tar.gz -C tf_model',shell=True,check=True)tf_model=tf.saved_model.load('tf_model')# download a single file, any format compatible with TorchAudiotorch.hub.download_url_to_file('https://opus-codec.org/static/examples/samples/speech_orig.wav',dst='speech_orig.wav',progress=True)test_files=['speech_orig.wav']batches=split_into_batches(test_files,batch_size=10)input=prepare_model_input(read_batch(batches[0]))# tf inferenceres=tf_model.signatures["serving_default"](tf.constant(input.numpy()))['output_0']print(decoder(torch.Tensor(res.numpy())[0]))Text-To-SpeechModels and SpeakersAll of the provided models are listed in themodels.ymlfile. Any meta-data and newer versions will be added there.V3V3 models supportSSML. Also see Colab examples for main SSML tag usage.IDSpeakersAuto-stressLanguageSRColabv3_1_ruaidar,baya,kseniya,xenia,eugene,randomyesru(Russian)8000,24000,48000v3_enen_0,en_1, ...,en_117,randomnoen(English)8000,24000,48000v3_en_indictamil_female, ...,assamese_male,randomnoen(English)8000,24000,48000v3_deeva_k, ...,karlsson,randomnode(German)8000,24000,48000v3_eses_0,es_1,es_2,randomnoes(Spanish)8000,24000,48000v3_frfr_0, ...,fr_5,randomnofr(French)8000,24000,48000v3_ttdilyaranott(Tatar)8000,24000,48000v3_uamykyta,randomnoua(Ukrainian)8000,24000,48000v3_uzdilnavoznouz(Uzbek)8000,24000,48000v3_xalerdni,delghir,randomnoxal(Kalmyk)8000,24000,48000v3_indichindi_male,hindi_female, ...,randomnoindic(Hindi, Telugu, ...)8000,24000,48000ru_v3aidar,baya,kseniya,xenia,randomyesru(Russian)8000,24000,48000DependenciesBasic dependencies for colab examples:torch, 1.10+;torchaudio, latest version bound to PyTorch should work (required only because models are hosted together with STT, not required for work);omegaconf,  latest (can be removed as well, if you do not load all of the configs);PyTorch# V3importtorchlanguage='ru'model_id='v3_1_ru'sample_rate=48000speaker='xenia'device=torch.device('cpu')model,example_text=torch.hub.load(repo_or_dir='snakers4/silero-models',model='silero_tts',language=language,speaker=model_id)model.to(device)# gpu or cpuaudio=model.apply_tts(text=example_text,speaker=speaker,sample_rate=sample_rate)Standalone UseStandalone usage just requires PyTorch 1.10+ and python standard library;Please see the detailed examples in Colab;# V3importosimporttorchdevice=torch.device('cpu')torch.set_num_threads(4)local_file='model.pt'ifnotos.path.isfile(local_file):torch.hub.download_url_to_file('https://models.silero.ai/models/tts/ru/v3_1_ru.pt',local_file)model=torch.package.PackageImporter(local_file).load_pickle("tts_models","model")model.to(device)example_text='В недрах тундры выдры в г+етрах т+ырят в вёдра ядра кедров.'sample_rate=48000speaker='baya'audio_paths=model.save_wav(text=example_text,speaker=speaker,sample_rate=sample_rate)SSMLCheck out ourTTS Wiki page.Indic languagesExample(!!!) All input sentences should be romanized to ISO format usingaksharamukhatool. An example forhindi:# V3importtorchfromaksharamukhaimporttransliterate# Loading modelmodel,example_text=torch.hub.load(repo_or_dir='snakers4/silero-models',model='silero_tts',language='indic',speaker='v3_indic')orig_text="प्रसिद्द कबीर अध्येता, पुरुषोत्तम अग्रवाल का यह शोध आलेख, उस रामानंद की खोज करता है"roman_text=transliterate.process('Devanagari','ISO',orig_text)print(roman_text)audio=model.apply_tts(roman_text,speaker='hindi_male')Supported languagesLanguageSpeakersRomanization functionhindihindi_female,hindi_maletransliterate.process('Devanagari', 'ISO', orig_text)malayalammalayalam_female,malayalam_maletransliterate.process('Malayalam', 'ISO', orig_text)manipurimanipuri_femaletransliterate.process('Bengali', 'ISO', orig_text)bengalibengali_female,bengali_maletransliterate.process('Bengali', 'ISO', orig_text)rajasthanirajasthani_female,rajasthani_femaletransliterate.process('Devanagari', 'ISO', orig_text)tamiltamil_female,tamil_maletransliterate.process('Tamil', 'ISO', orig_text, pre_options=['TamilTranscribe'])telugutelugu_female,telugu_maletransliterate.process('Telugu', 'ISO', orig_text)gujaratigujarati_female,gujarati_maletransliterate.process('Gujarati', 'ISO', orig_text)kannadakannada_female,kannada_maletransliterate.process('Kannada', 'ISO', orig_text)Text-EnhancementLanguagesQuantizationQualityColab'en', 'de', 'ru', 'es':heavy_check_mark:linkDependenciesBasic dependencies for colab examples:torch, 1.9+;pyyaml, but it's installed with torch itselfStandalone UseStandalone usage just requires PyTorch 1.9+ and python standard library;Please see the detailed examples inColab;importtorchmodel,example_texts,languages,punct,apply_te=torch.hub.load(repo_or_dir='snakers4/silero-models',model='silero_te')input_text=input('Enter input text\n')apply_te(input_text,lan='en')FAQWikiAlso check out ourwiki.Performance and QualityPlease refer to this wiki sections:Quality BenchmarksPerformance BenchmarksAdding new LanguagesPlease referhere.ContactGet in TouchTry our models, create anissue, join ourchat,emailus, read ournews.Commercial InquiriesPlease see ourwikiandtiersfor relevant information andemailus.Citations@misc{SileroModels,author={SileroTeam},title = {Silero Models: pre-trained enterprise-grade STT / TTS models and benchmarks},year = {2021},publisher = {GitHub},journal = {GitHub repository},howpublished = {\url{https://github.com/snakers4/silero-models}},commit = {insert_some_commit_here},email = {hello@silero.ai}}Further readingEnglishSTT:Towards an Imagenet Moment For Speech-To-Text -linkA Speech-To-Text Practitioners Criticisms of Industry and Academia -linkModern Google-level STT Models Released -linkTTS:Our new public speech synthesis in super-high quality, 10x faster and more stable -linkHigh-Quality Text-to-Speech Made Accessible, Simple and Fast -linkVAD:One Voice Detector to Rule Them All -linkModern Portable Voice Activity Detector Released -linkText Enhancement:We have published a model for text repunctuation and recapitalization for four languages -linkChineseSTT:迈向语音识别领域的 ImageNet 时刻 -link语音领域学术界和工业界的七宗罪 -linkRussianSTTНаши сервисы для бесплатного распознавания речи стали лучше и удобнее -linkTelegram-бот Silero бесплатно переводит речь в текст -linkБесплатное распознавание речи для всех желающих -linkПоследние обновления моделей распознавания речи из Silero Models -linkСжимаем трансформеры: простые, универсальные и прикладные способы cделать их компактными и быстрыми -linkУльтимативное сравнение систем распознавания речи: Ashmanov, Google, Sber, Silero, Tinkoff, Yandex -linkМы опубликовали современные STT модели сравнимые по качеству с Google -linkПонижаем барьеры на вход в распознавание речи -linkОгромный открытый датасет русской речи версия 1.0 -linkНасколько Быстрой Можно Сделать Систему STT? -linkНаша система Speech-To-Text -linkSpeech To Text -linkTTS:Теперь наш синтез на 20 языках -linkТеперь наш публичный синтез в супер-высоком качестве, в 10 раз быстрее и без детских болячек -linkСинтезируем голос бабушки, дедушки и Ленина + новости нашего публичного синтеза -linkМы сделали наш публичный синтез речи еще лучше -linkМы Опубликовали Качественный, Простой, Доступный и Быстрый Синтез Речи -linkVAD:А ты используешь VAD? Что это такое и зачем он нужен -linkМодели для Детекции Речи, Чисел и Распознавания Языков -linkМы опубликовали современный Voice Activity Detector и не только -linkText Enhancement:Восстановление знаков пунктуации и заглавных букв — теперь и на длинных текстах -linkМы опубликовали модель, расставляющую знаки препинания и заглавные буквы в тексте на четырех языках -linkDonationsPlease use the "sponsor" button.