Files
enginex-bi_series-vc-cnn/local_test.py
zhousha 55a67e817e update
2025-08-06 15:38:55 +08:00

64 lines
1.6 KiB
Python

import os
import tempfile
import shutil
if os.path.exists("/tmp/submit_private"):
shutil.rmtree("/tmp/submit_private")
with tempfile.TemporaryDirectory() as tempdir:
config_path = os.path.join(tempdir, "config.json")
assert not os.system(f"ssh-keygen -f {tempdir}/ssh-key-ecdsa -t ecdsa -b 521 -q -N \"\"")
config = """
model: whisper
model_key: whisper
config.json:
name: 'faster-whisper-server:latest'
support_devices:
- cpu
model_path: ''
port: 8080
other_ports: []
other_ports_count: 1
entrypoint: start.bat
MIN_CHUNK: 2.5
MIN_ADD_CHUNK: 2.5
COMPUTE_TYPE: int8
NUM_WORKERS: 1
CPU_THREADS: 2
BEAM_SIZE: 5
BATCH: 1
LANG: auto
DEVICE: cpu
CHUNK_LENGTH: 5
CLASS_MODEL: ./models/faster-whisper-base
EN_MODEL: ./models/faster-whisper-base
ZH_MODEL: ./models/faster-whisper-base
RU_MODEL: ./models/faster-whisper-base
PT_MODEL: ./models/faster-whisper-base
AR_MODEL: ./models/faster-whisper-base
NEW_VERSION: 1
NEED_RESET: 0
leaderboard_options:
nfs:
- name: whisper
srcRelativePath: leaderboard/pc_asr/en.tar.gz
mountPoint: /tmp
source: ceph_customer
"""
with open(config_path, "w") as f:
f.write(config)
os.environ["SSH_KEY_DIR"] = tempdir
os.environ["SUBMIT_CONFIG_FILEPATH"] = config_path
os.environ["MODEL_MAPPING"] = '{"whisper": "edge-ml.tar.gz"}'
from run_async_a10 import get_sut_url_windows
print(get_sut_url_windows())
import time
time.sleep(3600)