Files
FunASR/tutorial.html
2026-09-09 17:33:15 +00:00

316 lines
28 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<title>Your first transcription - FunASR</title>
<meta content="Your first transcription" name="description"/>
<meta content="#ffffff" name="theme-color"/>
<link href="https://www.funasr.com/en/docs/quickstart.html" rel="canonical"/>
<link href="https://www.funasr.com/docs/quickstart.html" hreflang="zh-CN" rel="alternate"/>
<link href="https://www.funasr.com/en/docs/quickstart.html" hreflang="en" rel="alternate"/>
<meta content="website" property="og:type"/>
<meta content="Your first transcription - FunASR" property="og:title"/>
<meta content="Your first transcription" property="og:description"/>
<meta content="https://www.funasr.com/en/docs/quickstart.html" property="og:url"/>
<link href="assets/css/site.7be954c8e106.css" rel="stylesheet"/>
<link href="assets/css/experience.34d6e632686e.css" rel="stylesheet"/>
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "SoftwareApplication", "applicationCategory": "DeveloperApplication", "codeRepository": "https://github.com/modelscope/FunASR", "dateModified": "2026-09-01", "license": "https://github.com/modelscope/FunASR/blob/main/LICENSE", "name": "FunASR", "operatingSystem": "Linux, macOS, Windows", "url": "https://www.funasr.com/en/docs/quickstart.html"}</script></head>
<body data-copy-icon="assets/lucide/copy.ea80e566c7a1.svg" data-language="en" data-route="/en/docs/quickstart.html">
<a class="skip-link" href="#main">Skip to main content</a>
<header class="site-header">
<a aria-label="FunASR home" class="brand" href="https://www.funasr.com/en/">
<span aria-hidden="true" class="brand-mark">F</span>
<span>FunASR</span>
</a>
<button aria-controls="primary-navigation" aria-expanded="false" class="icon-button menu-button" data-menu-toggle="" title="Open navigation" type="button">
<img alt="" src="assets/lucide/menu.90a31b3ab1cf.svg"/>
</button>
<nav aria-label="Primary navigation" class="primary-navigation" data-primary-nav="" id="primary-navigation">
<a href="https://www.funasr.com/en/">Product</a>
<a href="https://www.funasr.com/en/deploy/">Deploy</a>
<a href="https://www.funasr.com/en/models.html">Models</a>
<a href="https://www.funasr.com/en/benchmarks.html">Benchmarks</a>
<a href="https://www.funasr.com/en/ecosystem.html">Ecosystem</a>
<a href="https://www.funasr.com/en/blog/">Blog</a>
<a href="https://www.funasr.com/en/docs/">Docs</a>
<a href="https://www.funasr.com/en/donors.html">Donors</a>
</nav>
<div class="header-actions">
<a class="icon-link" href="https://www.funasr.com/docs/quickstart.html" title="简体中文">
<img alt="" src="assets/lucide/languages.ae9048feb2c7.svg"/>
<span>中文</span>
</a>
<a aria-label="GitHub" class="icon-button" href="https://www.funasr.com/go/github" title="GitHub">
<img alt="" src="assets/lucide/github.793554449a30.svg"/>
</a>
</div>
</header>
<main id="main">
<div class="docs-layout">
<aside class="docs-sidebar">
<a class="docs-home" href="https://www.funasr.com/en/docs/">Documentation</a>
<details class="docs-navigation" open="">
<summary class="docs-navigation-toggle">Browse topics</summary>
<details open="">
<summary>Get started</summary>
<nav aria-label="Get started">
<a href="https://www.funasr.com/en/docs/native-transformers.html">Transformers quickstart</a>
<a href="https://www.funasr.com/en/docs/installation.html">Installation &amp; environment checks</a>
<a aria-current="page" href="https://www.funasr.com/en/docs/quickstart.html">Your first transcription</a>
<a href="https://www.funasr.com/en/docs/python-api.html">Python SDK: AutoModel</a>
<a href="https://www.funasr.com/en/docs/model-selection.html">Choose your first model</a>
<a href="https://www.funasr.com/en/docs/command-line.html">Command-line transcription</a>
<a href="https://www.funasr.com/en/docs/migration.html">Migrate from Whisper &amp; cloud APIs</a>
</nav>
</details>
<details open="">
<summary>Models &amp; capabilities</summary>
<nav aria-label="Models &amp; capabilities">
<a href="https://www.funasr.com/en/docs/moss-transcribe-diarize.html">MOSS transcription &amp; diarization</a>
<a href="https://www.funasr.com/en/docs/model-zoo.html">Model Zoo</a>
<a href="https://www.funasr.com/en/docs/streaming-vad.html">Streaming voice activity detection</a>
<a href="https://www.funasr.com/en/docs/keyword-spotting.html">Keyword spotting</a>
<a href="https://www.funasr.com/en/docs/speaker-emotion.html">Speakers and emotion tags</a>
</nav>
</details>
<details open="">
<summary>Train &amp; extend</summary>
<nav aria-label="Train &amp; extend">
<a href="https://www.funasr.com/en/docs/training.html">Fine-tuning &amp; evaluation</a>
<a href="https://www.funasr.com/en/docs/model-registration.html">Custom model registration</a>
</nav>
</details>
<details open="">
<summary>Deploy &amp; integrate</summary>
<nav aria-label="Deploy &amp; integrate">
<a href="https://www.funasr.com/en/docs/docker.html">Containers &amp; image selection</a>
<a href="https://www.funasr.com/en/docs/runtime-guide.html">Serving entry points</a>
<a href="https://www.funasr.com/en/docs/http-server.html">Python HTTP service</a>
<a href="https://www.funasr.com/en/docs/kubernetes.html">Kubernetes deployment</a>
<a href="https://www.funasr.com/en/docs/deployment-matrix.html">Runtime &amp; deployment matrix</a>
<a href="https://www.funasr.com/en/docs/vllm.html">vLLM split-engine inference</a>
<a href="https://www.funasr.com/en/docs/official-native-vllm.html">Official native vLLM functional validation (2026-09-07)</a>
<a href="https://www.funasr.com/en/docs/native-vllm.html">Historical community native vLLM record (2026-08-13)</a>
</nav>
</details>
<details open="">
<summary>Evaluate &amp; operate</summary>
<nav aria-label="Evaluate &amp; operate">
<a href="https://www.funasr.com/en/docs/troubleshooting.html">Troubleshooting</a>
<a href="https://www.funasr.com/en/docs/security.html">Service security boundaries</a>
<a href="https://www.funasr.com/en/docs/benchmark-method.html">Reproducible performance tests</a>
<a href="https://www.funasr.com/en/docs/historical-asr-benchmark.html">Historical ASR benchmark</a>
<a href="https://www.funasr.com/en/docs/realtime-benchmark.html">Realtime WebSocket benchmarking</a>
</nav>
</details>
<details open="">
<summary>Applications &amp; ecosystem</summary>
<nav aria-label="Applications &amp; ecosystem">
<a href="https://www.funasr.com/en/docs/agent-integration.html">Agent integration</a>
<a href="https://www.funasr.com/en/docs/use-cases.html">Use cases &amp; examples</a>
<a href="https://www.funasr.com/en/docs/community.html">Community integrations</a>
<a href="https://www.funasr.com/en/docs/repositories.html">Repositories &amp; contribution paths</a>
<a href="https://www.funasr.com/en/docs/javascript.html">JavaScript clients</a>
<a href="https://www.funasr.com/en/docs/gradio.html">Gradio browser client</a>
<a href="https://www.funasr.com/en/docs/workflows.html">Workflow integrations</a>
</nav>
</details>
<details open="">
<summary>Protocols &amp; reference</summary>
<nav aria-label="Protocols &amp; reference">
<a href="https://www.funasr.com/en/docs/service-api.html">HTTP API contract</a>
<a href="https://www.funasr.com/en/docs/websocket-protocol.html">C++ WebSocket protocol</a>
<a href="https://www.funasr.com/en/docs/onnx-output.html">ONNX binary output contract</a>
</nav>
</details>
<a href="https://www.funasr.com/en/deploy/">Deployment guides →</a>
</details>
</aside>
<div class="docs-body">
<nav aria-label="Breadcrumbs" class="breadcrumbs"><a href="https://www.funasr.com/en/">FunASR</a><span>/</span><a href="https://www.funasr.com/en/docs/">Docs</a><span>/</span><span>Your first transcription</span></nav>
<header class="docs-title"><h1>Your first transcription</h1><a class="source-link" data-source-link="" href="https://github.com/modelscope/FunASR/blob/main/docs/tutorial/README.md">View / edit source ↗</a></header>
<article class="docs-article"><p>(<a href="https://www.funasr.com/docs/quickstart.html">简体中文</a> | English)</p>
<div class="source-title-anchor" id="python-sdk-tutorial"></div>
<blockquote>
<p><strong>Only need native Fun-ASR-Nano transcription?</strong> Start with <a href="https://www.funasr.com/en/docs/native-transformers.html">Transformers 5.17.0</a>. It loads the separate <code>-hf</code> checkpoint without the FunASR toolkit. This page covers the <code>funasr.AutoModel</code> toolkit path; do not mix dependencies, parameters or output contracts.</p>
</blockquote>
<p>Start with <a href="https://www.funasr.com/en/docs/installation.html">installation and environment verification</a>. This path covers one transcript, result inspection, VAD, batching, and model-specific options. For model selection, languages, dependencies, and model cards, use the <a href="https://www.funasr.com/en/docs/model-zoo.html">Model Zoo</a>, not a universal capability list. No local setup yet? See the <a href="https://github.com/modelscope/FunASR/blob/main/examples/colab/README.md">Colab quickstart</a>.</p>
<p>FunASR software uses the <a href="https://github.com/modelscope/FunASR/blob/main/LICENSE">MIT license</a>. Each model weight has its own license: record the full model ID and revision, and follow its model card. The <a href="https://github.com/modelscope/FunASR/blob/main/MODEL_LICENSE">FunASR Model License Agreement</a> applies only when the model card explicitly links to it. Third-party integrations remain third-party models; for example, MOSS-Transcribe-Diarize is from OpenMOSS, not a FunASR-trained checkpoint.</p>
<p><a id="Inference" name="Inference"></a></p>
<span data-legacy-doc-anchor="1-produce-a-first-transcript" id="quick"></span><span data-legacy-doc-anchor="1-produce-a-first-transcript" id="install"></span><span data-legacy-doc-anchor="1-produce-a-first-transcript" id="offline"></span><h2 id="1-produce-a-first-transcript">1. Produce a first transcript</h2>
<p>Run the following Python block after installing the SDK and a matching PyTorch/torchaudio environment. The first run needs network access for the model and this public example WAV, plus sufficient disk and memory. It is based on the repository's <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/paraformer/demo.py">Paraformer example</a>; it is not a recorded inference result from this documentation review.</p>
<pre id="code-0"><code class="language-python">from funasr import AutoModel
audio = "https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav"
model = AutoModel(
model="paraformer-zh", hub="ms", device="cpu", ncpu=4,
disable_update=True, trust_remote_code=False,
)
results = model.generate(input=audio)
for item in results:
print(item.get("key"), item.get("text", ""))
print("Model directory:", model.model_path)
</code></pre>
<p>To transcribe your recording, replace <code>audio</code> with an existing local WAV path. Start with a short mono recording matching the selected model's sample rate (16 kHz for this example). File decoding depends on installed audio backends; a readable WAV is a simpler first check than an arbitrary media container. NumPy waveform input has no sample-rate header: supply the actual rate with <code>fs=sample_rate</code>, as used by the <a href="https://github.com/modelscope/FunASR/blob/main/funasr/utils/load_utils.py">audio loader</a>. Do not merely relabel a waveform's rate.</p>
<p>The remaining Python blocks reuse <code>AutoModel</code>, <code>audio</code>, and <code>model</code> from this first block in the same session. For disconnected use, prepare complete local model directories and local input files using the <a href="https://www.funasr.com/en/docs/installation.html">offline checklist</a>. <code>disable_update=True</code> only skips the SDK's startup version check.</p>
<h2 id="2-understand-parameters-and-results">2. Understand parameters and results</h2>
<p><code>AutoModel(...)</code> constructs the model and optional pipeline components. <code>model.generate(input=..., **options)</code> performs inference. Source references: <a href="https://github.com/modelscope/FunASR/blob/main/funasr/auto/auto_model.py">AutoModel</a>, <a href="https://github.com/modelscope/FunASR/blob/main/funasr/download/name_maps_from_hub.py">hub aliases</a>, and the chosen model's <code>inference()</code> implementation.</p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Scope and meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>model</code>, <code>hub</code></td>
<td>Model ID/alias or local directory; hub defaults to ModelScope (<code>ms</code>), with <code>hf</code> for Hugging Face. Aliases can resolve to different hub repositories.</td>
</tr>
<tr>
<td><code>device</code>, <code>ncpu</code></td>
<td>Explicitly use <code>cpu</code> to begin; choose an accelerator only after validating its PyTorch build and model support. The loader has CPU fallback paths; <code>ncpu</code> controls PyTorch CPU threads.</td>
</tr>
<tr>
<td><code>vad_model</code>, <code>punc_model</code>, <code>spk_model</code></td>
<td>Optional, separately loaded models. Configure them through <code>vad_kwargs</code>, <code>punc_kwargs</code>, and <code>spk_kwargs</code>. They are not automatically supported by every ASR backend.</td>
</tr>
<tr>
<td><code>batch_size</code></td>
<td>Number of inputs per decoding batch on the ordinary non-VAD path; backend restrictions still apply.</td>
</tr>
<tr>
<td><code>batch_size_s</code></td>
<td>Duration budget in seconds for VAD-segment batching, based on padded segment length, not a count of files. The current CPU VAD path decodes segments individually.</td>
</tr>
<tr>
<td><code>batch_size_threshold_s</code></td>
<td>Segment-duration threshold used by the VAD batching heuristic; not an input duration limit or a universal memory cap.</td>
</tr>
<tr>
<td><code>output_dir</code></td>
<td>Optional backend output directory. The returned Python result is still available; files and formats depend on the model.</td>
</tr>
</tbody>
</table>
<p><code>generate()</code> returns a list of dictionaries, normally one per input recording. Inspect keys before depending on optional fields:</p>
<pre id="code-1"><code class="language-python">for item in results:
print(sorted(item.keys()))
print(item.get("text", ""))
print(item.get("timestamp", []))
</code></pre>
<p>For the Paraformer path, <code>timestamp</code> contains character/token/word intervals as <code>[start_ms, end_ms]</code> pairs when supplied by the checkpoint. Do not assume one pair per displayed character after punctuation or text normalization. Other backends may return <code>timestamps</code> with a different schema; follow that backend's guide. Empty speech may produce empty text/timestamps, not a meaningful transcript.</p>
<span data-legacy-doc-anchor="3-add-vad-punctuation-and-sentence-timestamps" id="spk"></span><span data-legacy-doc-anchor="3-add-vad-punctuation-and-sentence-timestamps" id="vad"></span><span data-legacy-doc-anchor="3-add-vad-punctuation-and-sentence-timestamps" id="punc"></span><span data-legacy-doc-anchor="3-add-vad-punctuation-and-sentence-timestamps" id="subtitle"></span><h2 id="3-add-vad-punctuation-and-sentence-timestamps">3. Add VAD, punctuation, and sentence timestamps</h2>
<p>VAD detects speech spans; it does not transcribe them. This standalone call uses the same audio:</p>
<pre id="code-2"><code class="language-python">vad = AutoModel(model="fsmn-vad", device="cpu", disable_update=True)
vad_results = vad.generate(input=audio)
for item in vad_results:
print(item["key"], item["value"])
</code></pre>
<p><code>value</code> is a list of <code>[start_ms, end_ms]</code> speech intervals relative to the recording start. An empty list means no detected spans. See the <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/fsmn_vad_streaming/demo.py">FSMN VAD example</a>.</p>
<p>For segmented ASR with punctuation:</p>
<pre id="code-3"><code class="language-python">pipeline = AutoModel(
model="paraformer-zh", vad_model="fsmn-vad", punc_model="ct-punc",
vad_kwargs={"max_single_segment_time": 30000},
device="cpu", disable_update=True, trust_remote_code=False,
)
segmented_results = pipeline.generate(
input=audio, batch_size_s=60, batch_size_threshold_s=30,
sentence_timestamp=True,
)
for item in segmented_results:
print(item.get("text", ""))
for sentence in item.get("sentence_info", []):
print(sentence.get("start"), sentence.get("end"), sentence.get("text", ""))
</code></pre>
<p><code>max_single_segment_time</code> is in <strong>milliseconds</strong>; the two batching controls are in <strong>seconds</strong>. Segmentation can help with longer files but does not guarantee unlimited duration or bounded memory: the audio-loading stage and each model still consume resources. On memory pressure, use shorter recordings/segments and smaller supported batches, then measure again. Sentence boundaries depend on available timestamp/punctuation alignment and may fall back to VAD segments; inspect the returned data.</p>
<p>For diarization, construct the same pipeline with <code>spk_model="cam++"</code> if supported by the chosen components. Iterate each input's <code>item.get("sentence_info", [])</code>, then read <code>sentence.get("spk")</code>. Do not read <code>spk</code> directly from the outer result list. Cluster labels are not verified real-world identities. <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/sense_voice/demo_spk.py">Speaker integration example</a>.</p>
<h2 id="4-process-multiple-recordings">4. Process multiple recordings</h2>
<p>The following deliberately repeats the sample to demonstrate a list input without requiring extra files. Replace the entries with your local WAV paths:</p>
<pre id="code-4"><code class="language-python">batch_results = model.generate(input=[audio, audio], batch_size=1)
for index, item in enumerate(batch_results):
print(index, item.get("key"), item.get("text", ""))
</code></pre>
<p>Increase <code>batch_size</code> only if the selected model supports it and memory permits. A file list such as <code>wav.scp</code> is also supported: use one <code>utterance_id path</code> per line, resolve paths from the process working directory, and give each recording a unique ID. Set <code>output_dir</code> if you need model-written artifacts; it is not required simply to receive the returned list. See <a href="https://github.com/modelscope/FunASR/blob/main/data/list/train_wav.scp">data-list examples</a>. Do not confuse independent file batching with streaming chunks of one utterance.</p>
<span data-legacy-doc-anchor="5-hotwords-and-language-boundaries" id="choose"></span><h2 id="5-hotwords-and-language-boundaries">5. Hotwords and language boundaries</h2>
<p>The ModelScope <code>paraformer-zh</code> alias in this checkout resolves to a SeACo Paraformer model, whose implementation accepts singular <code>hotword</code> as a space-separated string:</p>
<pre id="code-5"><code class="language-python">biased_results = model.generate(input=audio, hotword="魔搭 达摩院")
print([item.get("text", "") for item in biased_results])
</code></pre>
<p>This is model-level context biasing, not guaranteed word insertion or deterministic replacement. Verify the resolved model and compare against a no-hotword baseline. <a href="https://github.com/modelscope/FunASR/blob/main/funasr/models/seaco_paraformer/model.py">SeACo implementation</a> and <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/contextual_paraformer/demo.py">contextual Paraformer example</a>.</p>
<p>Postprocessing is a different operation in this source checkout:</p>
<pre id="code-6"><code class="language-python">corrected_results = model.generate(
input=audio,
postprocess_hotwords={"科大迅飞": "科大讯飞"},
return_postprocess_hotword_matches=True,
)
for item in corrected_results:
print(item.get("text", ""), item.get("postprocess_hotword_matches", []))
</code></pre>
<p>Explicit mappings replace matching output text. <code>postprocess_hotword_file</code> also accepts one target per line or <code>wrong=&gt;right</code> mappings. Fuzzy matching additionally needs <code>pypinyin</code> and <code>rapidfuzz</code>; explicit mappings do not. The <a href="https://github.com/modelscope/FunASR/blob/main/funasr/utils/postprocess_hotwords.py">postprocessor</a> preserves existing timestamps rather than realigning corrected text, so review replacements before making subtitles or alignment claims.</p>
<p><code>hotword</code>, <code>hotwords</code>, and <code>language</code> are <strong>not interchangeable universal SDK options</strong>. For example, <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/fun_asr_nano/README.md">Fun-ASR-Nano</a> reads plural <code>hotwords</code> and a model-specific language hint. Changing a hint does not turn a monolingual checkpoint into a multilingual one. Use the <a href="https://www.funasr.com/en/docs/model-zoo.html">Model Zoo</a> and the exact checkpoint guide for supported languages, accepted hint values, streaming, alignment, and dependency versions. Avoid copying language counts or installation pins between model families.</p>
<span data-legacy-doc-anchor="6-continue-with-a-specific-workflow" id="scenarios"></span><span data-legacy-doc-anchor="6-continue-with-a-specific-workflow" id="streaming"></span><span data-legacy-doc-anchor="6-continue-with-a-specific-workflow" id="emotion"></span><span data-legacy-doc-anchor="6-continue-with-a-specific-workflow" id="deploy-agent"></span><span data-legacy-doc-anchor="6-continue-with-a-specific-workflow" id="faq"></span><h2 id="6-continue-with-a-specific-workflow">6. Continue with a specific workflow</h2>
<ul>
<li><strong>Streaming:</strong> <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/paraformer_streaming/demo.py">Paraformer streaming example</a>. Keep a separate <code>cache={}</code> per stream and set <code>is_final=True</code> for the final chunk. For <code>[0, 10, 5]</code> at 16 kHz, 600 ms is <strong>9600 samples</strong>, not 960; chunk duration is not an end-to-end latency guarantee. Streaming VAD may return <code>[start, -1]</code>, <code>[-1, end]</code>, complete spans, or no spans, in milliseconds.</li>
<li><strong>Punctuation and alignment:</strong> <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/ct_transformer/demo.py">punctuation example</a> and <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/monotonic_aligner/demo.py">timestamp prediction example</a>. Alignment needs the corresponding text input; it is not equivalent to ASR.</li>
<li><strong>Other model families:</strong> <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/sense_voice/README.md">SenseVoice</a>, <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/fun_asr_nano/README.md">Fun-ASR-Nano</a>, and <a href="https://www.funasr.com/en/docs/moss-transcribe-diarize.html">third-party OpenMOSS integration</a>. Discover further entries through the Model Zoo.</li>
<li><strong>CLI and services:</strong> <a href="https://www.funasr.com/en/docs/command-line.html">CLI reference</a>, <a href="https://www.funasr.com/en/docs/runtime-guide.html">runtime overview</a>, and <a href="https://www.funasr.com/en/docs/docker.html">Docker</a>. Python options do not imply an identical server request schema.</li>
</ul>
<p><a id="Training" name="Training"></a></p>
<h2 id="model-training-and-testing">Model Training and Testing</h2>
<p>Use the <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/paraformer/README.md">Paraformer recipe</a>, <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/paraformer/finetune.sh">finetune.sh</a>, and <a href="https://github.com/modelscope/FunASR/blob/main/data/list/train.jsonl">training-data examples</a>. Inspect dataset paths, label alignment, model license, GPU allocation, and output directories before launching. Training is not an installation smoke test. For trained weights, inspect <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/paraformer/infer_from_local.sh">infer_from_local.sh</a>: configuration, tokenizer/frontend assets, and checkpoint paths must agree. Keep <a href="https://github.com/modelscope/FunASR/blob/main/data/list/val.jsonl">validation data</a> separate from training data.</p>
<p><a id="Export" name="Export"></a></p>
<span data-legacy-doc-anchor="model-export-and-testing" id="export"></span><h2 id="model-export-and-testing">Model Export and Testing</h2>
<p>Follow the model's <a href="https://github.com/modelscope/FunASR/blob/main/examples/industrial_data_pretraining/paraformer/export.py">Paraformer export example</a> and <a href="https://github.com/modelscope/FunASR/blob/main/runtime/python/onnxruntime/README.md">ONNX Runtime guide</a>. Export support and extra dependencies are model/backend-specific. Successful export is not evidence of output equivalence: test the exported artifact on representative inputs and compare with the original model before deployment.</p>
<p><a id="new-model-registration-tutorial" name="new-model-registration-tutorial"></a></p>
<h2 id="register-a-custom-model">Register a Custom Model</h2>
<p>Use the <a href="https://github.com/modelscope/FunASR/blob/main/docs/tutorial/Tables.md">registry tutorial</a> and a real implementation such as <a href="https://github.com/modelscope/FunASR/blob/main/funasr/models/sense_voice/model.py">SenseVoice</a>. Registration alone does not establish a working <code>generate()</code> contract; the model's inference result must match the downstream components it will use.</p>
<p>For failures, return to <a href="https://www.funasr.com/en/docs/troubleshooting.html">troubleshooting</a> with interpreter/package versions, resolved model ID/revision, input format, and a minimal reproduction. Do not include private audio or credentials.</p></article>
<nav aria-label="Adjacent documents" class="docs-next">
<a href="https://www.funasr.com/en/docs/installation.html">← Installation &amp; environment checks</a><a href="https://www.funasr.com/en/docs/python-api.html">Python SDK: AutoModel →</a> </nav>
</div>
<aside class="docs-toc"><strong>On this page</strong><div class="toc">
<ul>
<li><a href="#python-sdk-tutorial">Python SDK tutorial</a><ul>
<li><a href="#1-produce-a-first-transcript">1. Produce a first transcript</a></li>
<li><a href="#2-understand-parameters-and-results">2. Understand parameters and results</a></li>
<li><a href="#3-add-vad-punctuation-and-sentence-timestamps">3. Add VAD, punctuation, and sentence timestamps</a></li>
<li><a href="#4-process-multiple-recordings">4. Process multiple recordings</a></li>
<li><a href="#5-hotwords-and-language-boundaries">5. Hotwords and language boundaries</a></li>
<li><a href="#6-continue-with-a-specific-workflow">6. Continue with a specific workflow</a></li>
<li><a href="#model-training-and-testing">Model Training and Testing</a></li>
<li><a href="#model-export-and-testing">Model Export and Testing</a></li>
<li><a href="#register-a-custom-model">Register a Custom Model</a></li>
</ul>
</li>
</ul>
</div>
</aside></div>
</main>
<footer class="site-footer">
<div>
<strong>FunASR</strong>
<p>Open speech infrastructure for production deployment.</p>
</div>
<nav aria-label="Official repositories" class="footer-repositories" data-footer-repositories="">
<strong>Official repositories</strong>
<div class="footer-links">
<a href="https://www.funasr.com/go/fun-asr">Fun-ASR</a>
<a href="https://www.funasr.com/go/sensevoice">SenseVoice</a>
<a href="https://www.funasr.com/go/funclip">FunClip</a>
</div>
</nav>
<div class="footer-links">
<a href="https://www.funasr.com/en/deploy/">Deploy</a>
<a href="https://www.funasr.com/en/docs/">Docs</a>
<a href="https://www.funasr.com/go/releases">Releases</a>
<a href="https://www.funasr.com/en/donors.html">Donors</a>
</div>
</footer>
<script defer="" src="assets/js/site.d446f5fbcfe2.js"></script>
<script defer="" src="assets/js/experience.3f688a12942a.js"></script>
</body>
</html>