facebook/multilingual_librispeech
Viewer • Updated • 1.49M • 19.8k • 188
How to use q1805/hubert-large-german-v1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("automatic-speech-recognition", model="q1805/hubert-large-german-v1") # Load model directly
from transformers import AutoProcessor, AutoModelForCTC
processor = AutoProcessor.from_pretrained("q1805/hubert-large-german-v1")
model = AutoModelForCTC.from_pretrained("q1805/hubert-large-german-v1", device_map="auto")This repository hosts HuBERT Large German v1, an acoustic phoneme recognition model fine-tuned to predict the International Phonetic Alphabet (IPA) for German pronunciation evaluation.
facebook/hubert-large-ls960-ft (315M parameters).ˈ, ˌ, and German umlauts ä, ö, ü, ß).espeak-ng via phonemizer with German dialect flags (de).fp16).lr = 3e-5, linear warmup for 1,000 steps, linear decay).freeze_feature_encoder=True).import torch
import librosa
from transformers import Wav2Vec2Processor, HubertForCTC
# Load model and processor directly from Hugging Face
MODEL_ID = "q1805/hubert-large-german-v1"
processor = Wav2Vec2Processor.from_pretrained(MODEL_ID)
model = HubertForCTC.from_pretrained(MODEL_ID).eval()
# Load and resample audio
audio_path = "sample_german.wav"
speech, sr = librosa.load(audio_path, sr=16000)
# Inference
inputs = processor(speech, sampling_rate=16000, return_tensors="pt")
with torch.no_grad():
logits = model(inputs.input_values).logits
predicted_ids = torch.argmax(logits, dim=-1)
ipa_output = processor.batch_decode(predicted_ids)[0]
print("Predicted IPA:", ipa_output)
Base model
facebook/hubert-large-ls960-ft