openspeechapi 0.4.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/PKG-INFO +12 -1
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/cli.py +63 -3
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/core/base.py +101 -49
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/core/model_hub.py +179 -21
- openspeechapi-0.5.0/openspeechapi/core/model_presence.py +56 -0
- openspeechapi-0.5.0/openspeechapi/core/model_profile.py +131 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/dispatcher.py +35 -1
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/subprocess_exec.py +35 -18
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/engine_catalog.py +60 -3
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/engine_registry.yaml +43 -8
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/factory.py +10 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/aim_resolver.py +145 -8
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/backends/native_backend.py +16 -17
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/cosyvoice_venv.py +43 -93
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/sherpa_onnx.py +14 -9
- openspeechapi-0.5.0/openspeechapi/local_engines/engines/whisperlivekit.py +76 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/fish_venv.py +19 -48
- openspeechapi-0.5.0/openspeechapi/local_engines/gemma4_server.py +302 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/indextts_venv.py +22 -71
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/isolated_venv.py +33 -10
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/spark_venv.py +22 -71
- openspeechapi-0.5.0/openspeechapi/local_engines/venv_common.py +169 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/vllm_venv.py +8 -33
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/canary_qwen_stt.py +6 -9
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/deepgram.py +2 -1
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/dolphin_stt.py +85 -18
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/elevenlabs.py +18 -1
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/faster_whisper.py +9 -12
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/fireredasr_stt.py +21 -25
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/funasr_stt.py +20 -13
- openspeechapi-0.5.0/openspeechapi/providers/stt/gemma4.py +678 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/kimi_audio_stt.py +7 -6
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/mlx_whisper_stt.py +11 -8
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/mms_stt.py +6 -9
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/moonshine_stt.py +7 -10
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/paraformer.py +4 -3
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/parakeet_mlx_stt.py +11 -8
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/phi4_multimodal_stt.py +6 -9
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/qwen3_asr.py +10 -9
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/qwen3_omni_stt.py +235 -26
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/sensevoice.py +11 -8
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/sherpa_onnx.py +185 -10
- openspeechapi-0.5.0/openspeechapi/providers/stt/volcengine.py +172 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/vosk_stt.py +46 -1
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/voxtral_stt.py +66 -15
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/wenet_stt.py +60 -26
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/whisperlivekit.py +38 -1
- openspeechapi-0.5.0/openspeechapi/providers/tts/chatterbox.py +267 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/coqui.py +35 -5
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/cosyvoice.py +7 -2
- openspeechapi-0.5.0/openspeechapi/providers/tts/cosyvoice3.py +140 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/deepgram.py +9 -4
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/elevenlabs.py +55 -31
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/fish_speech.py +11 -8
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/indextts.py +10 -11
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/kokoro.py +7 -5
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/minimax.py +10 -2
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/spark.py +9 -12
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/volcengine.py +20 -6
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/app.py +58 -10
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/extras_installer.py +17 -2
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/model_downloads.py +79 -80
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/routes/chat.py +9 -2
- openspeechapi-0.5.0/openspeechapi/server/routes/config.py +395 -0
- openspeechapi-0.5.0/openspeechapi/server/routes/engine_catalog.py +785 -0
- openspeechapi-0.5.0/openspeechapi/server/routes/engine_services.py +221 -0
- openspeechapi-0.5.0/openspeechapi/server/routes/engines.py +153 -0
- openspeechapi-0.5.0/openspeechapi/server/routes/models.py +113 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/routes/stt.py +55 -27
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/routes/tts.py +6 -1
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/routes/webui.py +17 -3
- openspeechapi-0.5.0/openspeechapi/server/services/__init__.py +6 -0
- openspeechapi-0.5.0/openspeechapi/server/services/config_io.py +101 -0
- openspeechapi-0.5.0/openspeechapi/server/services/model_provision.py +118 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/system_metrics.py +98 -3
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/webui/app.js +278 -52
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/webui/index.html +5 -1
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/webui/styles.css +28 -4
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/ws/stt_stream.py +21 -5
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/ws/tts_stream.py +34 -1
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/utils/audio_converter.py +39 -10
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/providers.example.yaml +11 -9
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/pyproject.toml +30 -4
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/fish-speech/native/install.sh +17 -2
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/sherpa-onnx/native/install.sh +24 -2
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/sherpa-onnx/native/run_streaming_server.py +33 -15
- openspeechapi-0.5.0/scripts/engines/whisperlivekit/native/install.sh +118 -0
- openspeechapi-0.4.0/openspeechapi/local_engines/engines/whisperlivekit.py +0 -60
- openspeechapi-0.4.0/openspeechapi/providers/stt/gemma4.py +0 -442
- openspeechapi-0.4.0/openspeechapi/providers/stt/volcengine.py +0 -108
- openspeechapi-0.4.0/openspeechapi/server/routes/management.py +0 -1652
- openspeechapi-0.4.0/scripts/engines/whisperlivekit/native/install.sh +0 -86
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/.gitignore +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/README.md +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/__main__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/client/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/client/client.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/config.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/core/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/core/enums.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/core/models.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/core/registry.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/core/settings.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/core/voice_presets.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/demo.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/aim_provision.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/context.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/base.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/in_process.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/remote.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/fanout.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/filters.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/lifecycle.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/dispatch/watcher.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/exceptions.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/backends/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/backends/docker_backend.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/base.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/faster_whisper.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/fish_speech.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/whisper.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/manager.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/models.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/progress.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/registry.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/task_store.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/tasks.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/local_engines/vllm_gb10_patch.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/logging_config.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/observe/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/observe/base.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/observe/debug.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/observe/latency.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/observe/metrics.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/observe/tracing.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/observe/usage.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/_template.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/_local_audio.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/alibaba.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/assemblyai.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/azure_speech.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/baidu.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/google_cloud.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/iflytek.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/macos_speech.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/mms_languages.json +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/openai.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/tencent.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/whisper.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/stt/windows_speech.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/alibaba.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/azure_speech.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/baidu.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/f5_tts.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/google_cloud.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/iflytek.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/macos_say.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/openai.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/piper.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/tencent.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/providers/tts/windows_sapi.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/auth.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/middleware.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/native_installer.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/routes/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/server/ws/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/telemetry/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/telemetry/perf.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/utils/__init__.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/utils/audio_playback.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/openspeechapi/vendor_registry.yaml +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/aim_adopt.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/aim_consumers.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/cloud/install.sh +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/faster-whisper/native/install.sh +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/macos-stt/_bundle.sh +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/macos-stt/install.sh +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/macos-stt/macos_stt.swift +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/macos-stt/request_auth.swift +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/engines/whisper/native/install.sh +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/gen_mms_languages.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/preload_stt_model.py +0 -0
- {openspeechapi-0.4.0 → openspeechapi-0.5.0}/scripts/release.sh +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openspeechapi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Unified speech interface for STT/TTS providers
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Requires-Dist: httpx>=0.27
|
|
@@ -8,10 +8,13 @@ Requires-Dist: loguru>=0.7
|
|
|
8
8
|
Requires-Dist: msgpack>=1.0
|
|
9
9
|
Requires-Dist: pydantic>=2.0
|
|
10
10
|
Requires-Dist: pyyaml>=6.0
|
|
11
|
+
Provides-Extra: aim
|
|
12
|
+
Requires-Dist: ai-model-manager>=0.2.1; extra == 'aim'
|
|
11
13
|
Provides-Extra: alibaba
|
|
12
14
|
Provides-Extra: alibaba-stt
|
|
13
15
|
Provides-Extra: alibaba-tts
|
|
14
16
|
Provides-Extra: all
|
|
17
|
+
Requires-Dist: ai-model-manager>=0.2.1; extra == 'all'
|
|
15
18
|
Requires-Dist: elevenlabs; extra == 'all'
|
|
16
19
|
Requires-Dist: faster-whisper; extra == 'all'
|
|
17
20
|
Requires-Dist: openai; extra == 'all'
|
|
@@ -32,6 +35,9 @@ Provides-Extra: baidu
|
|
|
32
35
|
Provides-Extra: baidu-stt
|
|
33
36
|
Provides-Extra: baidu-tts
|
|
34
37
|
Provides-Extra: canary-qwen-stt
|
|
38
|
+
Provides-Extra: chatterbox-tts
|
|
39
|
+
Requires-Dist: chatterbox-tts; extra == 'chatterbox-tts'
|
|
40
|
+
Requires-Dist: soundfile; extra == 'chatterbox-tts'
|
|
35
41
|
Provides-Extra: cloud
|
|
36
42
|
Requires-Dist: websockets; extra == 'cloud'
|
|
37
43
|
Provides-Extra: coqui-tts
|
|
@@ -73,12 +79,15 @@ Requires-Dist: torch; extra == 'funasr-stt'
|
|
|
73
79
|
Requires-Dist: torchaudio; extra == 'funasr-stt'
|
|
74
80
|
Provides-Extra: gemma4-stt
|
|
75
81
|
Requires-Dist: accelerate; (sys_platform != 'darwin') and extra == 'gemma4-stt'
|
|
82
|
+
Requires-Dist: fastapi; extra == 'gemma4-stt'
|
|
76
83
|
Requires-Dist: librosa; (sys_platform != 'darwin') and extra == 'gemma4-stt'
|
|
77
84
|
Requires-Dist: mlx-vlm<0.6.2,>=0.6.1; (sys_platform == 'darwin') and extra == 'gemma4-stt'
|
|
78
85
|
Requires-Dist: pillow; (sys_platform != 'darwin') and extra == 'gemma4-stt'
|
|
79
86
|
Requires-Dist: torch; (sys_platform != 'darwin') and extra == 'gemma4-stt'
|
|
80
87
|
Requires-Dist: torchvision; (sys_platform != 'darwin') and extra == 'gemma4-stt'
|
|
81
88
|
Requires-Dist: transformers; (sys_platform != 'darwin') and extra == 'gemma4-stt'
|
|
89
|
+
Requires-Dist: transformers<5.13,>=5.5; (sys_platform == 'darwin') and extra == 'gemma4-stt'
|
|
90
|
+
Requires-Dist: uvicorn; extra == 'gemma4-stt'
|
|
82
91
|
Provides-Extra: google
|
|
83
92
|
Provides-Extra: google-stt
|
|
84
93
|
Provides-Extra: google-tts
|
|
@@ -143,6 +152,7 @@ Requires-Dist: funasr>=1.1.0; extra == 'sensevoice-stt'
|
|
|
143
152
|
Requires-Dist: torch; extra == 'sensevoice-stt'
|
|
144
153
|
Requires-Dist: torchaudio; extra == 'sensevoice-stt'
|
|
145
154
|
Provides-Extra: server
|
|
155
|
+
Requires-Dist: ai-model-manager>=0.2.1; extra == 'server'
|
|
146
156
|
Requires-Dist: fastapi; extra == 'server'
|
|
147
157
|
Requires-Dist: python-multipart; extra == 'server'
|
|
148
158
|
Requires-Dist: uvicorn; extra == 'server'
|
|
@@ -164,6 +174,7 @@ Requires-Dist: vosk; extra == 'vosk-stt'
|
|
|
164
174
|
Provides-Extra: voxtral-stt
|
|
165
175
|
Requires-Dist: accelerate; extra == 'voxtral-stt'
|
|
166
176
|
Requires-Dist: mistral-common[audio]>=1.8.1; extra == 'voxtral-stt'
|
|
177
|
+
Requires-Dist: sentencepiece; extra == 'voxtral-stt'
|
|
167
178
|
Requires-Dist: torch; extra == 'voxtral-stt'
|
|
168
179
|
Requires-Dist: transformers>=4.54.0; extra == 'voxtral-stt'
|
|
169
180
|
Provides-Extra: wenet-stt
|
|
@@ -70,12 +70,18 @@ def _server_base_url(args: argparse.Namespace) -> str:
|
|
|
70
70
|
return f"http://127.0.0.1:{port}"
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
def _http_json(method: str, url: str, timeout: float = 15.0) -> dict:
|
|
74
|
-
"""Minimal stdlib HTTP JSON call — keeps the client CLI path dependency-free.
|
|
73
|
+
def _http_json(method: str, url: str, timeout: float = 15.0, body: dict | None = None) -> dict:
|
|
74
|
+
"""Minimal stdlib HTTP JSON call — keeps the client CLI path dependency-free.
|
|
75
|
+
``body`` (optional dict) is JSON-encoded for POST/PUT."""
|
|
75
76
|
import json
|
|
76
77
|
import urllib.error
|
|
77
78
|
import urllib.request
|
|
78
|
-
|
|
79
|
+
data = None
|
|
80
|
+
headers = {}
|
|
81
|
+
if body is not None:
|
|
82
|
+
data = json.dumps(body).encode("utf-8")
|
|
83
|
+
headers["Content-Type"] = "application/json"
|
|
84
|
+
req = urllib.request.Request(url, method=method, data=data, headers=headers)
|
|
79
85
|
try:
|
|
80
86
|
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
|
81
87
|
body = resp.read().decode("utf-8")
|
|
@@ -341,6 +347,43 @@ def _load_dotenv() -> None:
|
|
|
341
347
|
pass
|
|
342
348
|
|
|
343
349
|
|
|
350
|
+
def _cmd_aim(args: argparse.Namespace) -> None:
|
|
351
|
+
"""aim (ai-model-manager) integration: status + user-initiated adopt(回纳管). Talks to a
|
|
352
|
+
running server over HTTP (the adopt scan needs the server's engine list)."""
|
|
353
|
+
base = _server_base_url(args)
|
|
354
|
+
try:
|
|
355
|
+
if args.aim_cmd == "status":
|
|
356
|
+
cfg = _http_json("GET", f"{base}/v1/admin/server-config")
|
|
357
|
+
adoptable = _http_json("GET", f"{base}/v1/models/aim/adoptable").get("adoptable", [])
|
|
358
|
+
print(f"aim available : {cfg.get('aim_available')}")
|
|
359
|
+
print(f"aim version : {cfg.get('aim_version')}")
|
|
360
|
+
print(f"store root : {cfg.get('aim_store_root')}")
|
|
361
|
+
print(f"adoptable : {len(adoptable)}")
|
|
362
|
+
for a in adoptable:
|
|
363
|
+
print(f" - {a['engine']}: {a['repo']}")
|
|
364
|
+
return
|
|
365
|
+
# adopt
|
|
366
|
+
adoptable = _http_json("GET", f"{base}/v1/models/aim/adoptable").get("adoptable", [])
|
|
367
|
+
if args.dry_run:
|
|
368
|
+
print("would adopt:" if adoptable else "nothing to adopt")
|
|
369
|
+
for a in adoptable:
|
|
370
|
+
print(f" - {a['engine']}: {a['repo']}")
|
|
371
|
+
return
|
|
372
|
+
if not args.all and not args.repo:
|
|
373
|
+
print("specify --all or --repo <id> (use --dry-run to preview)", file=sys.stderr)
|
|
374
|
+
sys.exit(2)
|
|
375
|
+
body = {"all": True} if args.all else {"repos": args.repo}
|
|
376
|
+
res = _http_json("POST", f"{base}/v1/models/aim/adopt", body=body)
|
|
377
|
+
adopting = res.get("adopting", [])
|
|
378
|
+
for t in adopting:
|
|
379
|
+
print(f"adopting {t['repo']} (task {t['task_id']})")
|
|
380
|
+
if not adopting:
|
|
381
|
+
print("nothing adopted")
|
|
382
|
+
except RuntimeError as e:
|
|
383
|
+
print(str(e), file=sys.stderr)
|
|
384
|
+
sys.exit(1)
|
|
385
|
+
|
|
386
|
+
|
|
344
387
|
def _add_logging_args(parser: argparse.ArgumentParser) -> None:
|
|
345
388
|
"""Register common logging flags on ``parser``.
|
|
346
389
|
|
|
@@ -514,6 +557,22 @@ def main(argv: list[str] | None = None) -> None:
|
|
|
514
557
|
task_cancel_p = task_sub.add_parser("cancel", help="Request cancellation for a task")
|
|
515
558
|
task_cancel_p.add_argument("--task-id", required=True, help="Task ID")
|
|
516
559
|
|
|
560
|
+
# aim (ai-model-manager) integration: status + user-initiated adopt (re-ingest cached models)
|
|
561
|
+
aim_p = sub.add_parser("aim", help="Manage aim (ai-model-manager) integration")
|
|
562
|
+
aim_sub = aim_p.add_subparsers(dest="aim_cmd", required=True)
|
|
563
|
+
# --url/--config live on a shared parent so they follow the subcommand (natural
|
|
564
|
+
# `aim status --url X`), not `aim --url X status`.
|
|
565
|
+
_aim_conn = argparse.ArgumentParser(add_help=False)
|
|
566
|
+
_aim_conn.add_argument("--url", default=None, help="Server base URL (default http://127.0.0.1:<port>)")
|
|
567
|
+
_aim_conn.add_argument("--config", default=None, help="Config path (to resolve default port)")
|
|
568
|
+
aim_sub.add_parser("status", parents=[_aim_conn],
|
|
569
|
+
help="aim detection + store root + adoptable count")
|
|
570
|
+
adopt_p = aim_sub.add_parser("adopt", parents=[_aim_conn],
|
|
571
|
+
help="Re-ingest already-downloaded models into aim")
|
|
572
|
+
adopt_p.add_argument("--all", action="store_true", help="Adopt all adoptable models")
|
|
573
|
+
adopt_p.add_argument("--repo", action="append", default=[], help="Specific repo id (repeatable)")
|
|
574
|
+
adopt_p.add_argument("--dry-run", action="store_true", help="Preview only (no changes)")
|
|
575
|
+
|
|
517
576
|
args = parser.parse_args(argv)
|
|
518
577
|
_apply_logging_args(args)
|
|
519
578
|
if args.command is None:
|
|
@@ -527,6 +586,7 @@ def main(argv: list[str] | None = None) -> None:
|
|
|
527
586
|
"load": _cmd_load,
|
|
528
587
|
"unload": _cmd_unload,
|
|
529
588
|
"engine": _cmd_engine,
|
|
589
|
+
"aim": _cmd_aim,
|
|
530
590
|
}
|
|
531
591
|
commands[args.command](args)
|
|
532
592
|
|
|
@@ -14,6 +14,11 @@ from openspeechapi.core.enums import AudioFormat, Capability, ExecMode, Provider
|
|
|
14
14
|
from openspeechapi.core.models import AudioChunk, AudioData, STTOptions, TTSOptions, Transcription
|
|
15
15
|
from openspeechapi.core.settings import BaseSettings
|
|
16
16
|
|
|
17
|
+
# Sentinel for _resolve_model(aim_spec=…): distinguishes "caller passed no spec →
|
|
18
|
+
# use self.aim_model_spec()" from "caller explicitly passed None → no aim". None is a
|
|
19
|
+
# valid aim_spec value (no aim), so a distinct sentinel is required.
|
|
20
|
+
_USE_SELF_AIM_SPEC = object()
|
|
21
|
+
|
|
17
22
|
|
|
18
23
|
@dataclass
|
|
19
24
|
class AimModelSpec:
|
|
@@ -94,49 +99,66 @@ class SpeechProvider(ABC):
|
|
|
94
99
|
# (long, model-load-appropriate) start timeout. None (default) = no pre-check.
|
|
95
100
|
required_import: str | None = None
|
|
96
101
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
``
|
|
103
|
-
|
|
104
|
-
in must prefer ``settings.model_path`` (when set and present on disk) in
|
|
105
|
-
their model-loading code, falling back to the repo id otherwise.
|
|
106
|
-
"""
|
|
102
|
+
@classmethod
|
|
103
|
+
def model_profile(cls, settings): # noqa: ANN001
|
|
104
|
+
"""声明式模型契约(server 进程内、纯字符串、绝不 import torch/mlx)。返回
|
|
105
|
+
:class:`~openspeechapi.core.model_profile.ModelProfile` 让框架派生所有静态钩子
|
|
106
|
+
(aim_model_spec / expected_local_repo / local_model_present / download_spec /
|
|
107
|
+
pending_aux_models);``None``(默认)= 未迁移 / 无本地下载,各钩子退回旧默认。
|
|
108
|
+
见 docs/superpowers/specs/2026-07-05-unified-model-management-design.md。"""
|
|
107
109
|
return None
|
|
108
110
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
def aim_model_spec(self) -> "AimModelSpec | None":
|
|
112
|
+
"""让 ``aim`` (ai-model-manager) 下载 + 管理本模型。默认从 :meth:`model_profile`
|
|
113
|
+
派生(主源可 aim → AimModelSpec;部分下载 → None);provider 若直接 override 本方法则
|
|
114
|
+
其 override 优先(Python MRO)。未迁移(model_profile=None)→ None,provider 自行 override
|
|
115
|
+
提供。opt-in 的 provider 加载时须优先用 ``settings.model_path``(已解析且在盘上时),否则
|
|
116
|
+
回退 repo id。"""
|
|
117
|
+
return self._aim_spec_for(self.settings)
|
|
118
|
+
|
|
119
|
+
def _aim_spec_for(self, settings) -> "AimModelSpec | None": # noqa: ANN001
|
|
120
|
+
"""从 **任意** settings 派生 aim spec(不限于静态 ``self.settings``)。
|
|
121
|
+
|
|
122
|
+
``aim_model_spec()`` = ``self._aim_spec_for(self.settings)`` 的静态特例。**按请求换
|
|
123
|
+
model 的引擎**(如 dolphin 的 small/base per-request 覆盖)在加载路径拿到有效配置 ``s``
|
|
124
|
+
后,须用 ``self._aim_spec_for(s)`` 取**该请求模型**的 spec —— 否则 ``_resolve_model``
|
|
125
|
+
默认用静态 config 的 spec,会把请求模型的目录错链到 config 模型的 store(踩过:base 被
|
|
126
|
+
链到 small store,base.pt 找不到 → 无结果)。"""
|
|
127
|
+
from openspeechapi.core.model_profile import derive_aim_spec
|
|
128
|
+
profile = type(self).model_profile(settings)
|
|
129
|
+
if profile is None:
|
|
130
|
+
return None
|
|
131
|
+
hub = getattr(settings, "hub", "") or ""
|
|
132
|
+
return derive_aim_spec(profile, hub)
|
|
133
|
+
|
|
134
|
+
@classmethod
|
|
135
|
+
def local_model_present(cls, settings) -> bool | None: # noqa: ANN001
|
|
136
|
+
"""该 config 的模型权重是否已在本机(「是否已下载」预检的**非标准**判定,如 piper)。
|
|
112
137
|
|
|
113
|
-
|
|
114
|
-
``model_is_cached`` / aim
|
|
115
|
-
|
|
116
|
-
才 override,直接报告**本 config** 的权重是否齐备。
|
|
138
|
+
默认从 :meth:`model_profile` 的部分下载源派生(有 ``allow_patterns`` → 校验那几个文件在否);
|
|
139
|
+
未迁移 / 无部分源 → ``None``(交标准 ``expected_local_repo`` + ``model_is_cached`` / aim 判断)。
|
|
140
|
+
provider 若直接 override 本方法则其 override 优先(MRO)。
|
|
117
141
|
|
|
118
142
|
与 ``expected_local_repo`` 同纪律:在 **server 进程** 调用 → 纯字符串/文件存在性逻辑,
|
|
119
143
|
绝不 import torch/transformers/mlx、绝不加载模型、绝不触发下载。``settings`` 可能是
|
|
120
|
-
dataclass 实例或 dict
|
|
121
|
-
|
|
122
|
-
return
|
|
144
|
+
dataclass 实例或 dict。"""
|
|
145
|
+
from openspeechapi.core.model_profile import derive_partial_present
|
|
146
|
+
return derive_partial_present(cls.model_profile(settings))
|
|
123
147
|
|
|
124
|
-
@
|
|
125
|
-
def download_spec(settings) -> dict | None: # noqa: ANN001
|
|
126
|
-
"""该引擎「下载模型」按钮触发的**部分 snapshot
|
|
127
|
-
|
|
128
|
-
走 aim 纳管的引擎用 ``aim_model_spec()``;无法 aim 纳管、又需从一个大仓只取若干文件
|
|
129
|
-
的引擎(典型:piper —— aim 无「部分仓/多文件」下载能力,``AimModelSpec`` 是单源)
|
|
130
|
-
override 本方法,返回::
|
|
148
|
+
@classmethod
|
|
149
|
+
def download_spec(cls, settings) -> dict | None: # noqa: ANN001
|
|
150
|
+
"""该引擎「下载模型」按钮触发的**部分 snapshot 下载**描述,默认从 :meth:`model_profile`
|
|
151
|
+
的非 aim-able 主源派生(piper 式部分下载),形如::
|
|
131
152
|
|
|
132
153
|
{"repo": "<hf repo>", "allow_patterns": ["<glob>", ...], "label": "<str>"}
|
|
133
154
|
|
|
134
|
-
|
|
135
|
-
|
|
155
|
+
走 aim 纳管的引擎(整仓 hf/ms 或单文件 url)→ ``None``(交 ``aim_model_spec()``)。未迁移 /
|
|
156
|
+
无部分源 → ``None``。provider 若直接 override 本方法则其 override 优先(MRO)。
|
|
136
157
|
|
|
137
158
|
同 ``expected_local_repo`` 纪律:server 进程内调用,纯字符串逻辑、不加载模型、不下载。
|
|
138
|
-
``settings`` 可能是 dataclass 实例或 dict
|
|
139
|
-
|
|
159
|
+
``settings`` 可能是 dataclass 实例或 dict。"""
|
|
160
|
+
from openspeechapi.core.model_profile import derive_download_spec
|
|
161
|
+
return derive_download_spec(cls.model_profile(settings))
|
|
140
162
|
|
|
141
163
|
@staticmethod
|
|
142
164
|
def pending_reference_asr(settings, opts) -> dict | None: # noqa: ANN001
|
|
@@ -151,49 +173,79 @@ class SpeechProvider(ABC):
|
|
|
151
173
|
``settings`` 可能是 dataclass 或 dict;``opts`` 为本次请求的 ``TTSOptions``。"""
|
|
152
174
|
return None
|
|
153
175
|
|
|
154
|
-
@
|
|
155
|
-
def pending_aux_models(settings, opts) -> "list[dict] | None": # noqa: ANN001
|
|
156
|
-
"""该引擎首次加载时要下的**辅助模型**里,尚未缓存的那些(
|
|
176
|
+
@classmethod
|
|
177
|
+
def pending_aux_models(cls, settings, opts) -> "list[dict] | None": # noqa: ANN001, ARG003
|
|
178
|
+
"""该引擎首次加载时要下的**辅助模型**里,尚未缓存的那些(默认从 :meth:`model_profile` 的
|
|
179
|
+
``aux`` 派生:检查各 aux 源缓存缺失项)。
|
|
157
180
|
|
|
158
181
|
某些 SDK(如 IndexTTS2)在加载主模型时,会在 worker 里静默现下若干 GB 的辅助模型
|
|
159
|
-
(w2v-bert / codec / vocoder 等)——违反「前后台状态同步」+「绝不 worker
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
182
|
+
(w2v-bert / codec / vocoder 等)——违反「前后台状态同步」+「绝不 worker 静默现下」。合成
|
|
183
|
+
前置 gate 据本钩子的缺失列表 ``[{repo, allow_patterns, label}, ...]`` 起**追踪下载**(上
|
|
184
|
+
Dashboard)+ 返回 409 ``model_downloading`` + 前端自动重试;待全部就绪后 provider 把它们
|
|
185
|
+
显式喂给 SDK。未迁移 / 无 aux → ``None``。provider 若直接 override 则其 override 优先(MRO)。
|
|
186
|
+
``opts`` 保留签名兼容(aux 恒为静态,不依赖单次请求)。
|
|
164
187
|
|
|
165
188
|
同 ``download_spec`` 纪律:server 进程内调用,纯字符串/缓存存在性逻辑,绝不加载模型/下载。"""
|
|
166
|
-
|
|
189
|
+
from openspeechapi.core.model_profile import derive_missing_aux
|
|
190
|
+
return derive_missing_aux(cls.model_profile(settings))
|
|
167
191
|
|
|
168
192
|
@classmethod
|
|
169
193
|
def expected_local_repo(cls, settings) -> str | None: # noqa: ANN001
|
|
170
194
|
"""该引擎在本机会从本地缓存加载的 HF repo id(用于「是否已下载」预检)。
|
|
171
195
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
196
|
+
已迁移(:meth:`model_profile` 非空)→ 从 profile 派生(``expected_repo or primary.repo``,
|
|
197
|
+
且形如合法 HF id);未迁移 → 旧默认(``settings.model`` 且含 ``/``)。平台会重映射 repo 的
|
|
198
|
+
引擎(如 gemma4)经 ``profile.expected_repo`` 表达。provider 若直接 override 则其 override
|
|
199
|
+
优先(MRO)。
|
|
200
|
+
|
|
201
|
+
在 **server 进程** 里调用 —— 本方法及其所有 override 必须是 **纯字符串逻辑**:绝不 import
|
|
202
|
+
torch / transformers / mlx,绝不加载模型。``settings`` 可能是 dataclass 实例或 dict。"""
|
|
203
|
+
from openspeechapi.core.model_profile import derive_expected_repo
|
|
204
|
+
profile = cls.model_profile(settings)
|
|
205
|
+
if profile is not None:
|
|
206
|
+
return derive_expected_repo(profile)
|
|
178
207
|
model = settings.get("model") if isinstance(settings, dict) else getattr(settings, "model", None)
|
|
179
208
|
model = (model or "").strip()
|
|
180
209
|
return model if "/" in model else None
|
|
181
210
|
|
|
211
|
+
def _config_model_path_for(self, requested_model: str, model_field: str = "model") -> str:
|
|
212
|
+
"""The static ``settings.model_path`` belongs to the CONFIGURED model ONLY. For a per-request
|
|
213
|
+
model override (a different variant), passing it downstream silently loads the config model —
|
|
214
|
+
``aim_local_path_or`` / ``resolve_hub_model`` short-circuit on any present path (the C1 bug:
|
|
215
|
+
切变体静默加载配置模型). Return ``model_path`` ONLY when the requested model IS the config
|
|
216
|
+
model; else ``""`` so the loader resolves the REQUESTED model's own aim-store path / repo id
|
|
217
|
+
(``resolve_hub_model`` / ``_resolve_model`` then look the requested model up in the aim store;
|
|
218
|
+
a direct ``aim_local_path_or`` caller falls back to the repo id, which aim relinks into the HF
|
|
219
|
+
cache). This is the LOAD-side mirror of the gate-side guard
|
|
220
|
+
``dispatcher._config_model_path_present`` (rule 11).
|
|
221
|
+
|
|
222
|
+
``model_field``: the settings attr holding the variant selector — usually ``model``, but a
|
|
223
|
+
few engines use a bespoke name (faster_whisper's ``model_size``; see H6)."""
|
|
224
|
+
from openspeechapi.core.model_profile import sget
|
|
225
|
+
config_model = (sget(self.settings, model_field) or "").strip()
|
|
226
|
+
mp = getattr(self.settings, "model_path", "") or ""
|
|
227
|
+
return mp if (requested_model or "").strip() == config_model else ""
|
|
228
|
+
|
|
182
229
|
def _resolve_model(
|
|
183
230
|
self, repo: str, *, hub: str = "", model_path: str = "",
|
|
184
231
|
ms_repo_map: "dict[str, str] | None" = None, custom_url: str = "",
|
|
185
232
|
fixed_path: str = "", category: str = "asr/model",
|
|
186
|
-
snapshot: bool = False,
|
|
233
|
+
snapshot: bool = False, aim_spec: Any = _USE_SELF_AIM_SPEC,
|
|
187
234
|
) -> str:
|
|
188
235
|
"""Resolve this provider's model via the unified chain
|
|
189
236
|
(model_path → aim → global source → custom url → symlink). See model_hub.
|
|
190
237
|
|
|
191
238
|
Pass ``snapshot=True`` for loaders that require a real local directory
|
|
192
239
|
even when the source is HF (e.g. dolphin). The resolver will call
|
|
193
|
-
``huggingface_hub.snapshot_download`` and return the local dir path.
|
|
240
|
+
``huggingface_hub.snapshot_download`` and return the local dir path.
|
|
241
|
+
|
|
242
|
+
``aim_spec``: 默认(sentinel)用 ``self.aim_model_spec()``(静态 config 的 spec)——
|
|
243
|
+
对「加载即 config 模型」的引擎正确。**按请求换 model 的引擎**须显式传 ``self._aim_spec_for(s)``
|
|
244
|
+
(该请求模型的 spec),否则 aim 会把请求模型的 ``fixed_path`` 错链到 config 模型的 store。"""
|
|
194
245
|
from openspeechapi.core.model_hub import resolve_model_source # local: avoid cycle
|
|
246
|
+
spec = self.aim_model_spec() if aim_spec is _USE_SELF_AIM_SPEC else aim_spec
|
|
195
247
|
return resolve_model_source(
|
|
196
|
-
repo, hub=hub, model_path=model_path, aim_spec=
|
|
248
|
+
repo, hub=hub, model_path=model_path, aim_spec=spec,
|
|
197
249
|
ms_repo_map=ms_repo_map, custom_url=custom_url, fixed_path=fixed_path,
|
|
198
250
|
category=category, snapshot=snapshot,
|
|
199
251
|
)
|