feat: merge reply emotions while preserving configurable Qwen/Doubao provider
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Portable model-free archive regression: isolated temp root + synthetic persona manifests."""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
@@ -9,11 +10,22 @@ import sys
|
||||
import tempfile
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--vad-model', type=Path, help='Existing authorized Silero artifact; read only, never downloaded')
|
||||
args=parser.parse_args()
|
||||
with tempfile.TemporaryDirectory(prefix='lan-voice-archive-check-') as folder:
|
||||
stage = Path(folder)
|
||||
for source in root.glob('*.py'): shutil.copy2(source, stage/source.name)
|
||||
for name in ('tests','personas','web'):
|
||||
shutil.copytree(root/name, stage/name, ignore=shutil.ignore_patterns('__pycache__'))
|
||||
if args.vad_model:
|
||||
import hashlib
|
||||
model=args.vad_model.resolve(strict=True)
|
||||
sys.path.insert(0,str(root))
|
||||
from importlib.util import spec_from_file_location, module_from_spec
|
||||
spec=spec_from_file_location('vad_app',root/'app.py');module=module_from_spec(spec);spec.loader.exec_module(module)
|
||||
assert hashlib.sha256(model.read_bytes()).hexdigest()==module.EXPECTED_HASH, 'Silero artifact checksum'
|
||||
(stage/'models').mkdir();(stage/'models/silero_vad.onnx').symlink_to(model)
|
||||
target=stage/'.runtime/personas'; target.mkdir(parents=True)
|
||||
for name in ('lvbu','yangmi_fiction'):
|
||||
# Public dummy IDs only; no production profile/reference audio/runtime copied.
|
||||
@@ -29,7 +41,7 @@ def safe(suite):
|
||||
result=unittest.TestSuite()
|
||||
for item in suite:
|
||||
if isinstance(item,unittest.TestSuite): result.addTest(safe(item))
|
||||
elif item.id().endswith('.test_silero_silence_and_state'):
|
||||
elif item.id().endswith('.test_silero_silence_and_state') and not Path('models/silero_vad.onnx').exists():
|
||||
# Model artifacts are intentionally absent; never download/load a model in archive checks.
|
||||
item.setUp=lambda: (_ for _ in ()).throw(unittest.SkipTest('Silero artifact excluded from source archive'))
|
||||
result.addTest(item)
|
||||
|
||||
Reference in New Issue
Block a user