Skip to content

FunASR-powered video transcription, subtitle generation, and LLM-assisted clipping tool with a local Gradio UI.

feat: add Fun-ASR-Nano model support with timestamp and speaker diarization

游雁36bcaf23851f
diff --git a/README.md b/README.md
index ed21e2e..e898cd8 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,7 @@
<a name="What's New"></a>
## What's New🚀
+- 2026/05/20 FunClip now supports Fun-ASR-Nano model with higher accuracy, timestamp and speaker diarization for 31 languages. Run `python funclip/launch.py -m fun-asr-nano` to try.
- 2024/06/12 FunClip supports recognize and clip English audio files now. Run `python funclip/launch.py -l en` to try.
- 🔥2024/05/13 FunClip v2.0.0 now supports smart clipping with large language models, integrating models from the qwen series, GPT series, etc., providing default prompts. You can also explore and share tips for setting prompts, the usage is as follows:
1. After the recognition, select the name of the large model and configure your own apikey;
@@ -107,6 +108,7 @@ wget https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ClipVideo/STHeitiMed
You can establish your own FunClip service which is same as [Modelscope Space](https://modelscope.cn/studios/iic/funasr_app_clipvideo/summary) as follow:
```shell
python funclip/launch.py
+# '-m fun-asr-nano' for Fun-ASR-Nano model (higher accuracy, 31 languages)
# '-l en' for English audio recognize
# '-p xxx' for setting port number
# '-s True' for establishing service for public accessing
diff --git a/funclip/launch.py b/funclip/launch.py
index 48c026e..1409224 100644
--- a/funclip/launch.py
+++ b/funclip/launch.py
@@ -22,17 +22,29 @@ from introduction import top_md_1, top_md_3, top_md_4
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='argparse testing')
parser.add_argument('--lang', '-l', type=str, default = "zh", help="language")
+ parser.add_argument('--model', '-m', type=str, default="paraformer", choices=["paraformer", "fun-asr-nano"], help="ASR model: paraformer or fun-asr-nano")
parser.add_argument('--share', '-s', action='store_true', help="if to establish gradio share link")
parser.add_argument('--port', '-p', type=int, default=7860, help='port number')
parser.add_argument('--listen', action='store_true', help="if to listen to all hosts")
args = parser.parse_args()
if args.lang == 'zh':
- funasr_model = AutoModel(model="iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
- vad_model="damo/speech_fsmn_vad_zh-cn-16k-common-pytorch",
- punc_model="damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch",
- spk_model="damo/speech_campplus_sv_zh-cn_16k-common",
- )
+ if hasattr(args, 'model') and args.model == 'fun-asr-nano':
+ funasr_model = AutoModel(model="FunAudioLLM/Fun-ASR-Nano-2512",
+ trust_remote_code=True,
+ remote_code="./model.py",
+ vad_model="fsmn-vad",
+ vad_kwargs={"max_single_segment_time": 30000},
+ punc_model="ct-punc",
+ spk_model="cam++",
+ hub="hf",
+ )
+ else:
+ funasr_model = AutoModel(model="iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
+ vad_model="damo/speech_fsmn_vad_zh-cn-16k-common-pytorch",
+ punc_model="damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch",
+ spk_model="damo/speech_campplus_sv_zh-cn_16k-common",
+ )
else:
funasr_model = AutoModel(model="iic/speech_paraformer_asr-en-16k-vocab4199-pytorch",
vad_model="damo/speech_fsmn_vad_zh-cn-16k-common-pytorch",