Skip to content
ModelListedExternal
Download

Cohere Darija LoRA 10 7 26

This model is a fine-tuned LoRA adapter for the CohereLabs/cohere-transcribe-arabic-07-2026 Automatic Speech Recognition (ASR) model. It has been specifically trained to improve transcription accuracy for Moroccan...

KindLoRABase modelCohereLabs/cohere-transcribe-arabic-07-2026Versionadapter_model

Model source

Kind
LoRA
File size
126 MB
Base model
CohereLabs/cohere-transcribe-arabic-07-2026
Version
vadapter_model
Updated
Sep 14, 2026
Downloads
4
Source
Hugging Face

Source description

Cohere ASR - Moroccan Darija (LoRA Adapter)

This model is a fine-tuned LoRA adapter for the CohereLabs/cohere-transcribe-arabic-07-2026 Automatic Speech Recognition (ASR) model. It has been specifically trained to improve transcription accuracy for Moroccan Darija.

Model Details

Training Configuration

The model was fine-tuned using Parameter-Efficient Fine-Tuning (PEFT) with LoRA and 8-bit quantization.

  • Steps: 500
  • Batch Size: 4 (with Gradient Accumulation Steps = 4)
  • Learning Rate: 1e-4
  • Precision: 32-bit (fp16 disabled to prevent NaN loss in the audio architecture)

How to Use

You can use this adapter by loading the base model and merging it with this LoRA repository.

import librosa
import torch
from transformers import AutoFeatureExtractor, AutoTokenizer, CohereAsrForConditionalGeneration
from peft import PeftModel

base_model_id = "CohereLabs/cohere-transcribe-arabic-07-2026"
adapter_repo = "amzilmustapha/cohere-darija-lora-10-7-26"
hf_token = "YOUR_HF_TOKEN" # Required for the gated base model

# Load processors
feature_extractor = AutoFeatureExtractor.from_pretrained(base_model_id, trust_remote_code=True, token=hf_token)
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True, token=hf_token)

# Load base model
base_model = CohereAsrForConditionalGeneration.from_pretrained(
    base_model_id, 
    device_map="auto", 
    trust_remote_code=True, 
    token=hf_token
)

# Apply LoRA Adapter
model = PeftModel.from_pretrained(base_model, adapter_repo, token=hf_token)

# Process Audio
audio_file = "your_darija_audio.wav" 
audio_array, sampling_rate = librosa.load(audio_file, sr=16000)
inputs = feature_extractor(audio_array, sampling_rate=16000, return_tensors="pt")
input_features = inputs.input_features.to(model.device)

# Generate Transcription
with torch.no_grad():
    generated_ids = model.generate(inputs=input_features, max_new_tokens=100)

transcription = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(transcription)

Sources

1 source
Hugging FacePrimaryVersion 62b404e762b51c97e8167cbc2fb9781e356d6a1f
huggingface.co/amzilmustapha/cohere-darija-lora-10-7-26/tree/62b404e762b51c97e8167cbc2fb9781e356d6a1f

Verified Sep 14

Model artifacts

1 artifact

adapter_model.safetensors

safetensors · 126 MB · SHA-256 1cd72b3f87cc…c149 · Hugging Face

Download

Source excerpts

2 excerpts

--- language: - ar tags: - automatic-speech-recognition - speech-to-text - darija - moroccan-arabic - peft - lora base_model: CohereLabs/cohere-transcribe-arabic-07-2026 datasets: - atlasia/DODa-audio-dataset --- # Cohere ASR - Moroccan Darija (LoRA Adapter) This model is a fine-tuned LoRA adapter for the `CohereLabs/cohere-transcribe-arabic-07-2026` Automatic Speech Recognition (ASR) model. It has been specifically trained to improve transcription accuracy for **Moroccan Darija**. ## Model Details - **Base Model:** [CohereLabs/cohere-transcribe-arabic-07-2026](https://huggingface.co/CohereLabs/cohere-transcribe-arabic-07-2026) - **Dataset:** Fine-tuned on the [atlasia/DODa-audio-dataset](https://huggingface.co/datasets/atlasia/DODa-audio-dataset) (Moroccan Darija audio samples). - **Task:** Speech-to-Text / Automatic Speech Recognition (ASR) - **Language:** Moroccan Arabic (Darija) ## Training Configuration The model was fine-tuned using Parameter-Efficient Fine-Tuning (PEFT) with LoRA and 8-bit quantization. - **Steps:** 500 - **Batch Size:** 4 (with Gradient Accumulation Steps = 4) - **Learning Rate:** 1e-4 - **Precision:** 32-bit (fp16 disabled to prevent NaN loss in the audio architecture) ## How to Use You can use this adapter by loading the base model and merging it with this LoRA repository. ```python import librosa import torch from transformers import AutoFeatureExtractor, AutoTokenizer, CohereAsrForConditionalGeneration from peft import PeftModel base_model_id = "CohereLabs/cohere-transcribe-arabic-07-2026" adapter_repo = "amzilmustapha/cohere-darija-lora-10-7-26" hf_token = "YOUR_HF_TOKEN" # Required for the gated base model # Load processors feature_extractor = AutoFeatureExtractor.from_pretrained(base_model_id, trust_remote_code=True, token=hf_token) tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True, token=hf_token) # Load base model base_model = CohereAsrForConditionalGeneration.from_pretrained( base_model_id, device_map="auto", trust_remote_code=True, token=hf_token ) # Apply LoRA Adapter model = PeftModel.from_pretrained(base_model, adapter_repo, token=hf_token) # Process Audio audio_file = "your_darija_audio.wav" audio_array, sampling_rate = librosa.load(audio_file, sr=16000) inputs = feature_extractor(audio_array, sampling_rate=16000, return_tensors="pt") input_features = inputs.input_featur...

Source context: 4 downloads · 0 likes · Pipeline automatic-speech-recognition · Library peft · Repo amzilmustapha/cohere-darija-lora-10-7-26