How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("automatic-speech-recognition", model="hangulonline/whisper-small-korean-kss")
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("hangulonline/whisper-small-korean-kss", device_map="auto")
Quick Links

Whisper Small - Korean KSS (Fine-tuned with LoRA)

Mô hình nhận dạng giọng nói tiếng Hàn (ASR) được fine-tune từ openai/whisper-small sử dụng tập dữ liệu Korean Single Speaker Speech (KSS) thông qua phương pháp LoRA (Low-Rank Adaptation).

📝 Blog: Hành Trình Fine-tune Whisper trên MacBook M1

Bạn có bao giờ nghĩ rằng mình có thể huấn luyện một mô hình AI nhận dạng giọng nói chuyên nghiệp chỉ với một chiếc laptop cá nhân? Chúng tôi đã hiện thực hóa điều đó bằng cách tinh chỉnh mô hình OpenAI Whisper ngay trên chip Apple Silicon.

1. "Nguyên liệu" đầu vào: Tập dữ liệu KSS

Chúng tôi sử dụng tập dữ liệu Korean Single Speaker (KSS) – gồm 12.853 đoạn âm thanh (khoảng 12 giờ) của một nữ phát ngôn viên chuyên nghiệp. Đây là bộ dữ liệu có chất lượng âm thanh cực kỳ sạch, lý tưởng cho việc huấn luyện ASR.

2. Công nghệ then chốt: PEFT & LoRA

Thay vì dạy mô hình từ con số 0, chúng tôi chọn phương pháp Fine-tuning sử dụng kỹ thuật LoRA (Low-Rank Adaptation). Thay vì cập nhật hàng triệu tham số, chúng tôi chỉ gắn thêm các "lớp lọc" siêu nhỏ (Rank=8). Điều này giúp giảm lượng tài nguyên tính toán xuống mức tối thiểu, cho phép chạy mượt mà trên GPU tích hợp của chip M1 thông qua Apple MPS.

3. Quy trình Huấn luyện Cuốn Chiếu

Để quản lý bộ nhớ hiệu quả, chúng tôi chia dữ liệu thành từng phần và thực hiện huấn luyện cuốn chiếu (Incremental Training). Kết quả của giai đoạn trước được dùng làm nền tảng cho giai đoạn sau, đảm bảo quá trình huấn luyện bền bỉ và không gây quá tải hệ thống.


🛠️ Hướng dẫn sử dụng

from transformers import WhisperProcessor, WhisperForConditionalGeneration
from peft import PeftModel
import torch
import librosa

# Cấu hình thiết bị
device = "mps" if torch.backends.mps.is_available() else "cuda" if torch.cuda.is_available() else "cpu"

# Tải Processor và Model
model_id = "openai/whisper-small"
peft_model_id = "hangulonline/whisper-small-korean-kss"

processor = WhisperProcessor.from_pretrained(model_id)
base_model = WhisperForConditionalGeneration.from_pretrained(model_id)
model = PeftModel.from_pretrained(base_model, peft_model_id)
model.to(device)

# Dự đoán
audio, _ = librosa.load("audio_sample.wav", sr=16000)
input_features = processor(audio, sampling_rate=16000, return_tensors="pt").input_features.to(device)
predicted_ids = model.generate(input_features, language="korean", task="transcribe")
print(processor.batch_decode(predicted_ids, skip_special_tokens=True)[0])

📊 Thông tin Dự án

  • Đội ngũ phát triển: Nguyễn Đức Tuấn
  • Phương pháp: LoRA (Low-Rank Adaptation)
  • Phần cứng: Apple Silicon M1 (MPS Backend)
  • Giấy phép: CC BY-NC-SA 4.0

📚 References

  1. OpenAI Whisper: Robust Speech Recognition via Large-Scale Weak Supervision arXiv:2212.04356
  2. LoRA: Low-Rank Adaptation of Large Language Models arXiv:2106.09685
  3. KSS Dataset: Kaggle Link
  4. PEFT Library: Hugging Face Documentation

Copyright (c) 2026 Nguyễn Đức Tuấn. Toàn bộ nội dung và trọng số mô hình được bảo vệ dưới giấy phép CC BY-NC-SA 4.0.

Downloads last month
6
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for hangulonline/whisper-small-korean-kss

Adapter
(277)
this model

Papers for hangulonline/whisper-small-korean-kss