Automatic Speech Recognition
Transformers
Safetensors
Khmer
English
French
psarai_s2s
feature-extraction
speech-to-speech-translation
speech-translation
text-to-speech
khmer
code-switching
custom_code
Instructions to use nphearum/PsarAI-S2S with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nphearum/PsarAI-S2S with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="nphearum/PsarAI-S2S", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nphearum/PsarAI-S2S", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from nphearum/PsarAI-S2S: direct link, hf CLI and curl.
- Browser
- Download file 4.31 kB
-
https://huggingface.co/nphearum/PsarAI-S2S/resolve/main/config.json
- Command line
-
hf download hf://nphearum/PsarAI-S2S/config.json
-
curl -L -o config.json https://huggingface.co/nphearum/PsarAI-S2S/resolve/main/config.json
4.31 kB
| { | |
| "architectures": [ | |
| "PsarAIModel" | |
| ], | |
| "asr": { | |
| "activation_dropout": 0.05, | |
| "adapter_attn_dim": 16, | |
| "adapter_kernel_size": 3, | |
| "adapter_stride": 2, | |
| "add_adapter": false, | |
| "apply_spec_augment": true, | |
| "architectures": [ | |
| "Wav2Vec2ForCTC" | |
| ], | |
| "attention_dropout": 0.05, | |
| "bos_token_id": 1, | |
| "chunk_size_feed_forward": 0, | |
| "classifier_proj_size": 256, | |
| "codevector_dim": 1024, | |
| "contrastive_logits_temperature": 0.1, | |
| "conv_bias": true, | |
| "conv_dim": [ | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512 | |
| ], | |
| "conv_kernel": [ | |
| 10, | |
| 3, | |
| 3, | |
| 3, | |
| 3, | |
| 2, | |
| 2 | |
| ], | |
| "conv_stride": [ | |
| 5, | |
| 2, | |
| 2, | |
| 2, | |
| 2, | |
| 2, | |
| 2 | |
| ], | |
| "ctc_loss_reduction": "mean", | |
| "ctc_zero_infinity": false, | |
| "diversity_loss_weight": 0.1, | |
| "do_stable_layer_norm": true, | |
| "dtype": "float32", | |
| "eos_token_id": 2, | |
| "feat_extract_activation": "gelu", | |
| "feat_extract_dropout": 0.0, | |
| "feat_extract_norm": "layer", | |
| "feat_proj_dropout": 0.05, | |
| "feat_quantizer_dropout": 0.0, | |
| "final_dropout": 0.05, | |
| "hidden_act": "gelu", | |
| "hidden_dropout": 0.05, | |
| "hidden_size": 1280, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 5120, | |
| "is_encoder_decoder": false, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "layer_norm_eps": 1e-05, | |
| "layerdrop": 0.05, | |
| "mask_feature_length": 10, | |
| "mask_feature_min_masks": 0, | |
| "mask_feature_prob": 0.0, | |
| "mask_time_length": 10, | |
| "mask_time_min_masks": 2, | |
| "mask_time_prob": 0.05, | |
| "model_type": "wav2vec2", | |
| "num_adapter_layers": 3, | |
| "num_attention_heads": 16, | |
| "num_codevector_groups": 2, | |
| "num_codevectors_per_group": 320, | |
| "num_conv_pos_embedding_groups": 16, | |
| "num_conv_pos_embeddings": 128, | |
| "num_feat_extract_layers": 7, | |
| "num_hidden_layers": 48, | |
| "num_negatives": 100, | |
| "output_attentions": false, | |
| "output_hidden_size": 1280, | |
| "output_hidden_states": false, | |
| "pad_token_id": 0, | |
| "problem_type": null, | |
| "proj_codevector_dim": 1024, | |
| "return_dict": true, | |
| "tdnn_dilation": [ | |
| 1, | |
| 2, | |
| 3, | |
| 1, | |
| 1 | |
| ], | |
| "tdnn_dim": [ | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 1500 | |
| ], | |
| "tdnn_kernel": [ | |
| 5, | |
| 3, | |
| 3, | |
| 1, | |
| 1 | |
| ], | |
| "transformers_version": "5.20.2", | |
| "use_weighted_layer_sum": false, | |
| "vocab_size": 158, | |
| "xvector_output_dim": 512 | |
| }, | |
| "asr_adapters": { | |
| "auto": 158, | |
| "bridge": 153, | |
| "eng": 43, | |
| "fra": 60 | |
| }, | |
| "auto_map": { | |
| "AutoConfig": "modeling_psarai.PsarAIConfig", | |
| "AutoModel": "modeling_psarai.PsarAIModel" | |
| }, | |
| "bridge": { | |
| "asr_dim": 1280, | |
| "asr_layers": 49, | |
| "mt_dim": 1024 | |
| }, | |
| "dtype": "float16", | |
| "model_type": "psarai_s2s", | |
| "mt": { | |
| "activation_dropout": 0.0, | |
| "activation_function": "relu", | |
| "architectures": [ | |
| "M2M100ForConditionalGeneration" | |
| ], | |
| "attention_dropout": 0.1, | |
| "bos_token_id": 0, | |
| "chunk_size_feed_forward": 0, | |
| "d_model": 1024, | |
| "decoder_attention_heads": 16, | |
| "decoder_ffn_dim": 4096, | |
| "decoder_layerdrop": 0, | |
| "decoder_layers": 12, | |
| "decoder_start_token_id": 2, | |
| "dropout": 0.1, | |
| "dtype": "float32", | |
| "encoder_attention_heads": 16, | |
| "encoder_ffn_dim": 4096, | |
| "encoder_layerdrop": 0, | |
| "encoder_layers": 12, | |
| "eos_token_id": 2, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "init_std": 0.02, | |
| "is_encoder_decoder": true, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "max_position_embeddings": 1024, | |
| "model_type": "m2m_100", | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "pad_token_id": 1, | |
| "problem_type": null, | |
| "return_dict": true, | |
| "scale_embedding": true, | |
| "tie_word_embeddings": true, | |
| "tokenizer_class": "NllbTokenizer", | |
| "transformers_version": "5.20.2", | |
| "use_cache": false, | |
| "vocab_size": 256206 | |
| }, | |
| "sample_rate": 24000, | |
| "speak_languages": [ | |
| "km", | |
| "en" | |
| ], | |
| "t2u": { | |
| "n_units": 1000, | |
| "speakers": 2 | |
| }, | |
| "transformers_version": "5.20.2", | |
| "vocoder": { | |
| "n_units": 1000 | |
| } | |
| } | |