fixed tenvad

This commit is contained in:
rahulpscraftech360 2025-08-18 15:18:11 +05:30
parent 3371c45608
commit 1d0aaa5e15
7 changed files with 187 additions and 139 deletions

4
.gitignore vendored
View file

@ -161,6 +161,10 @@ main/manager-web/node_modules
# model files - exclude entire models directory since they auto-download
main/xiaozhi-server/models/
models/sherpa-onnx-zipformer-gigaspeech-2023-12-12/
# Exception for ten-vad-onnx - include this model with its libraries
!main/xiaozhi-server/models/ten-vad-onnx/
!main/xiaozhi-server/models/ten-vad-onnx/**
/main/xiaozhi-server/audio_ref/
/audio_ref/
/asr-models/iic/SenseVoiceSmall/

View file

@ -0,0 +1,44 @@
#!/usr/bin/env python3
"""Test TEN VAD ONNX installation on Linux"""
import os
import sys
import platform
from pathlib import Path
print(f"Platform: {platform.system()} {platform.machine()}")
print(f"Python: {sys.version}")
# Add the model path to sys.path
model_path = Path("models/ten-vad-onnx")
print(f"Model path: {model_path.absolute()}")
# Check if files exist
ten_vad_py = model_path / "ten_vad.py"
lib_so = model_path / "lib" / "Linux" / "x64" / "libten_vad.so"
lib_so_alt = model_path / "ten_vad_library" / "libten_vad.so"
print(f"\nFile checks:")
print(f"ten_vad.py exists: {ten_vad_py.exists()}")
print(f"libten_vad.so (main) exists: {lib_so.exists()}")
print(f"libten_vad.so (alt) exists: {lib_so_alt.exists()}")
# Set library path
os.environ['LD_LIBRARY_PATH'] = f"{lib_so.parent}:{lib_so_alt.parent}:{os.environ.get('LD_LIBRARY_PATH', '')}"
print(f"\nLD_LIBRARY_PATH: {os.environ['LD_LIBRARY_PATH']}")
# Try to import
sys.path.insert(0, str(model_path))
try:
print("\nAttempting to import ten_vad...")
from ten_vad import TenVad
print("✅ Successfully imported TenVad")
# Try to create instance
vad = TenVad(hop_size=256, threshold=0.5)
print("✅ Successfully created TenVad instance")
except Exception as e:
print(f"❌ Import failed: {e}")
import traceback
traceback.print_exc()