YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Paraformer_sc_kws

A fine-tuned Paraformer model based on FunASR for Sichuan dialect keyword recognition.

Files

  • model.pth: PyTorch model weights
  • config.yaml: Model configuration
  • hotwords.txt:hotwords list

Installation

  • Requirements
  python>=3.8
  torch>=1.13
  torchaudio
  • install
  git clone https://github.com/alibaba/FunASR.git && cd FunASR
  pip3 install -e ./
  pip install huggingface huggingface_hub

Usage

import torch
from funasr import AutoModel

# 下载模型
from huggingface_hub import snapshot_download
snapshot_download(repo_id="JoeyPilgrim/paraformer_sc_kws", local_dir="your_model_path")

# 加载热词
with open("your_model_path/hotwords.txt", "r") as f:
    hotwords = " ".join([word.strip() for word in f.readlines()])
# 加载模型
model = AutoModel(model="your_model_path")

result = model.generate(input="your_audio.wav", hotword=hotwords)
if result[0]["text"] in hotwords:
  print(result)
else:
  print("")
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support