From cd0b273a3d529faf2c98b60a27fc8610e52884ab Mon Sep 17 00:00:00 2001 From: LauraGPT Date: Tue, 1 Sep 2026 06:51:04 +0000 Subject: [PATCH] deploy: c688455fce7cf424056a298fdcfad34df509e18c --- api.html | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/api.html b/api.html index 86e637bf4..106d43b12 100644 --- a/api.html +++ b/api.html @@ -22923,7 +22923,7 @@ else: print(f"You are using the latest version of funasr-{current_version}") -
function

extract_language_from_asr_text(text)

funasr.bin._server_app ยท View on GitHub โ†—

Extract a SenseVoice language code before special tokens are removed.

+
function

extract_language_from_asr_text(text)

funasr.bin._server_app ยท View on GitHub โ†—

Extract a SenseVoice language code before special tokens are removed.

๐Ÿ“„ Source code
def extract_language_from_asr_text(text):
     """Extract a SenseVoice language code before special tokens are removed."""
     if not isinstance(text, str):
@@ -22931,7 +22931,7 @@
     match = _LANGUAGE_TAG_RE.search(text)
     return match.group(1) if match else None
 
-
function

resolve_transcription_language(requested_language, result)

funasr.bin._server_app ยท View on GitHub โ†—

Prefer the caller's language hint, then backend detection, else unknown.

+
function

resolve_transcription_language(requested_language, result)

funasr.bin._server_app ยท View on GitHub โ†—

Prefer the caller's language hint, then backend detection, else unknown.

๐Ÿ“„ Source code
def resolve_transcription_language(requested_language, result):
     """Prefer the caller's language hint, then backend detection, else unknown."""
     if requested_language and requested_language.strip().lower() != "auto":
@@ -22941,7 +22941,7 @@
         return detected_language
     return "unknown"
 
-
function

build_openai_fallback_segments(text, duration, max_chars)

funasr.bin._server_app ยท View on GitHub โ†—

Build coarse timestamped segments when a backend returns text only.

+
function

build_openai_fallback_segments(text, duration, max_chars)

funasr.bin._server_app ยท View on GitHub โ†—

Build coarse timestamped segments when a backend returns text only.

๐Ÿ“„ Source code
def build_openai_fallback_segments(text: str, duration: float, max_chars: int = 80):
     """Build coarse timestamped segments when a backend returns text only."""
     parts = _split_text_for_openai_segments(text, max_chars=max_chars)
@@ -22966,7 +22966,7 @@
 
     return segments
 
-
function

prepare_audio_for_inference(audio_data, sr, target_sr)

funasr.bin._server_app ยท View on GitHub โ†—

Return mono float32 audio at target_sr for ASR inference.

+
function

prepare_audio_for_inference(audio_data, sr, target_sr)

funasr.bin._server_app ยท View on GitHub โ†—

Return mono float32 audio at target_sr for ASR inference.

๐Ÿ“„ Source code
def prepare_audio_for_inference(audio_data, sr, target_sr=16000):
     """Return mono float32 audio at target_sr for ASR inference."""
     audio_data = np.asarray(audio_data)
@@ -22981,7 +22981,7 @@
 
     return audio_data.astype(np.float32), sr
 
-
function

attach_speaker_labels(audio_data, sr, segments, speaker_model, device)

funasr.bin._server_app ยท View on GitHub โ†—

Run speaker diarization once and attach labels to timestamped segments.

+
function

attach_speaker_labels(audio_data, sr, segments, speaker_model, device)

funasr.bin._server_app ยท View on GitHub โ†—

Run speaker diarization once and attach labels to timestamped segments.

๐Ÿ“„ Source code
def attach_speaker_labels(audio_data, sr, segments, speaker_model, device):
     """Run speaker diarization once and attach labels to timestamped segments."""
     if not segments:
@@ -23012,8 +23012,8 @@
     speaker_results = speaker_model.generate(
         input=[chunk[2] for chunk in chunks], cache={}, is_final=True
     )
-
View full source on GitHub โ†’
-
function

build_openai_verbose_json(result, requested_language)

funasr.bin._server_app ยท View on GitHub โ†—

Build OpenAI-compatible verbose JSON while preserving FunASR extensions.

+View full source on GitHub โ†’
+
function

build_openai_verbose_json(result, requested_language)

funasr.bin._server_app ยท View on GitHub โ†—

Build OpenAI-compatible verbose JSON while preserving FunASR extensions.

๐Ÿ“„ Source code
def build_openai_verbose_json(result, requested_language=None):
     """Build OpenAI-compatible verbose JSON while preserving FunASR extensions."""
     segments = []
@@ -23037,7 +23037,7 @@
         "segments": segments,
     }
 
-
function

create_app(device, preload_model, model_path, hub, spk_model, cors_origins)

funasr.bin._server_app ยท View on GitHub โ†—

No documentation yet.

๐Ÿ“„ Source code
def create_app(
+
function

create_app(device, preload_model, model_path, hub, spk_model, cors_origins)

funasr.bin._server_app ยท View on GitHub โ†—

No documentation yet.

๐Ÿ“„ Source code
def create_app(
     device: str = "cuda",
     preload_model: str = "auto",
     model_path: str = None,
@@ -23067,7 +23067,7 @@
         app.add_middleware(
             CORSMiddleware,
             allow_origins=normalized_origins,
-
View full source on GitHub โ†’
+
View full source on GitHub โ†’
function

main_hydra(kwargs)

funasr.bin.compute_audio_cmvn ยท View on GitHub โ†—

Main hydra.

Args:

    @@ -23935,10 +23935,10 @@ args = build_arg_parser().parse_args() asyncio.run(main(args))
-
function

server_version_label()

funasr.bin.server ยท View on GitHub โ†—

No documentation yet.

๐Ÿ“„ Source code
def server_version_label():
+
function

server_version_label()

funasr.bin.server ยท View on GitHub โ†—

No documentation yet.

๐Ÿ“„ Source code
def server_version_label():
     return f"FunASR Server v{PACKAGE_VERSION}"
 
-
function

build_parser()

funasr.bin.server ยท View on GitHub โ†—

No documentation yet.

๐Ÿ“„ Source code
def build_parser():
+
function

build_parser()

funasr.bin.server ยท View on GitHub โ†—

No documentation yet.

๐Ÿ“„ Source code
def build_parser():
     parser = argparse.ArgumentParser(
         description="FunASR OpenAI-Compatible API Server",
         formatter_class=argparse.RawDescriptionHelpFormatter,
@@ -23947,6 +23947,7 @@ Examples:
   funasr-server                          # Start with SenseVoice on GPU
   funasr-server --device cpu             # Start on CPU
   funasr-server --model paraformer       # Use Paraformer model
+  funasr-server --model moss-transcribe-diarize --device cuda:0
   funasr-server --port 9000             # Custom port
   funasr-server --model-path /path/to/local/model  # Use local model
   funasr-server --model-path username/model --hub hf  # Use HuggingFace model
@@ -23961,15 +23962,14 @@ Then use with OpenAI SDK:
     parser.add_argument("--host", default="0.0.0.0", help="Bind address (default: 0.0.0.0)")
     parser.add_argument("--port", type=int, default=8000, help="Port (default: 8000)")
     parser.add_argument("--device", default="cuda", help="Device: cuda, cpu, mps (default: cuda)")
-    parser.add_argument("--model", default="auto", help="Pre-load model: auto (GPU=fun-asr-nano, CPU=sensevoice), sensevoice, paraformer, fun-asr-nano")
-    parser.add_argument("--model-path", default=None, help="Local model path or model ID (overrides --model)")
-    parser.add_argument("--hub", default="ms", help="Model hub: ms (ModelScope), hf (HuggingFace) (default: ms)")
     parser.add_argument(
-        "--spk-model",
-        default="cam++",
-        help="Speaker model loaded on the first spk=true request (default: cam++)",
-
View full source on GitHub โ†’
-
function

main()

funasr.bin.server ยท View on GitHub โ†—

No documentation yet.

๐Ÿ“„ Source code
def main():
+        "--model",
+        default="auto",
+        help=(
+            "Pre-load model: auto (GPU=fun-asr-nano, CPU=sensevoice), "
+            "sensevoice, paraformer, fun-asr-nano, moss-transcribe-diarize"
+
View full source on GitHub โ†’
+
function

main()

funasr.bin.server ยท View on GitHub โ†—

No documentation yet.

๐Ÿ“„ Source code
def main():
     args = build_parser().parse_args()
 
     try:
@@ -23999,7 +23999,7 @@ Then use with OpenAI SDK:
     print(f"โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—")
     print(f"โ•‘  {server_version_label():<44}โ•‘")
     print(f"โ•‘  Device: {args.device:<8}                          โ•‘")
-
View full source on GitHub โ†’
+
View full source on GitHub โ†’
function

field2slice(field)

funasr.bin.tokenize_text ยท View on GitHub โ†—

Convert field string to slice

Note that field string accepts 1-based integer.

Examples: