更新
This commit is contained in:
@@ -115,6 +115,25 @@ qt_multimedia_hiddenimports = [
|
||||
if importlib.util.find_spec("opencc") is None:
|
||||
raise SystemExit("Install the project dependencies before packaging (missing opencc)")
|
||||
transcript_datas, transcript_binaries, transcript_hiddenimports = collect_all("opencc")
|
||||
# The realtime path remains Tencent. This explicit build profile adds offline
|
||||
# recovery for uploaded recordings whose realtime text is missing/incomplete.
|
||||
# It never installs dependencies or downloads a model during build/runtime.
|
||||
if os.environ.get("DOCTOR_INCLUDE_AUDIO_RECOVERY") == "1":
|
||||
for package in ("faster_whisper", "ctranslate2", "onnxruntime", "av", "tokenizers"):
|
||||
if importlib.util.find_spec(package) is None:
|
||||
raise SystemExit(f"Audio recovery requires the local-asr extra: missing {package}")
|
||||
data, binaries, imports = collect_all(package)
|
||||
transcript_datas += data
|
||||
transcript_binaries += binaries
|
||||
transcript_hiddenimports += imports
|
||||
recovery_model = Path(os.environ.get("DOCTOR_ASR_MODEL_PATH") or RESOURCES / "local-asr" / "model")
|
||||
required = ("model.bin", "config.json", "tokenizer.json")
|
||||
if (not all((recovery_model / name).is_file() and (recovery_model / name).stat().st_size > 0
|
||||
for name in required)
|
||||
or not any((recovery_model / name).is_file() and (recovery_model / name).stat().st_size > 0
|
||||
for name in ("vocabulary.txt", "vocabulary.json"))):
|
||||
raise SystemExit("Audio recovery requires a complete, already installed local model")
|
||||
transcript_datas.append((str(recovery_model.resolve()), "resources/local-asr/model"))
|
||||
client_resources = [
|
||||
(str(entry), f"resources/{entry.name}" if entry.is_dir() else "resources")
|
||||
for entry in RESOURCES.iterdir()
|
||||
|
||||
Reference in New Issue
Block a user