Automatic Speech Recognition
Transformers
ONNX
Arabic
English
cohere_asr
speech-recognition
sherpa-onnx
cohere-asr
arabic
Instructions to use abdelmoez98/cohere-transcribe-arabic-07-2026-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abdelmoez98/cohere-transcribe-arabic-07-2026-ONNX with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="abdelmoez98/cohere-transcribe-arabic-07-2026-ONNX")# Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("abdelmoez98/cohere-transcribe-arabic-07-2026-ONNX") model = AutoModelForSpeechSeq2Seq.from_pretrained("abdelmoez98/cohere-transcribe-arabic-07-2026-ONNX", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| import torch | |
| from transformers import PretrainedConfig | |
| DEFAULT_SUPPORTED_LANGUAGES = ["ar", "en"] | |
| NO_SPACE_LANGS = {} | |
| class CohereAsrConfig(PretrainedConfig): | |
| """Configuration for the Cohere ASR remote-code model.""" | |
| model_type = "cohere_asr" | |
| def __init__( | |
| self, | |
| vocab_size=16384, | |
| encoder=None, | |
| transf_decoder=None, | |
| head=None, | |
| preprocessor=None, | |
| max_audio_clip_s=35, | |
| overlap_chunk_second=5, | |
| min_energy_window_samples=1600, | |
| batch_size=64, | |
| sample_rate=16000, | |
| supported_languages=None, | |
| **kwargs, | |
| ): | |
| kwargs.setdefault("is_encoder_decoder", True) | |
| self.vocab_size = vocab_size | |
| self.encoder = encoder | |
| self.transf_decoder = transf_decoder | |
| self.head = head | |
| self.preprocessor = preprocessor | |
| self.max_audio_clip_s = max_audio_clip_s | |
| self.overlap_chunk_second = overlap_chunk_second | |
| self.min_energy_window_samples = min_energy_window_samples | |
| self.batch_size = batch_size | |
| self.sample_rate = sample_rate | |
| self.supported_languages = ( | |
| list(supported_languages) if supported_languages is not None else list(DEFAULT_SUPPORTED_LANGUAGES) | |
| ) | |
| super().__init__(**kwargs) | |
| def num_hidden_layers(self): | |
| return self.transf_decoder["config_dict"]["num_layers"] | |
| def num_hidden_layers(self, value): | |
| self.transf_decoder["config_dict"]["num_layers"] = value | |
| if hasattr(torch, "_dynamo") and hasattr(torch._dynamo, "disable"): | |
| _dynamo_disable = torch._dynamo.disable | |
| else: | |
| def _dynamo_disable(fn): | |
| return fn | |