forked from groxaxo/parakeet-tdt-0.6b-v3-fastapi-openai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_onnx_asr.py
More file actions
54 lines (44 loc) · 1.55 KB
/
test_onnx_asr.py
File metadata and controls
54 lines (44 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
import inspect
import onnx_asr
print(
"onnx_asr version:",
onnx_asr.__version__ if hasattr(onnx_asr, "__version__") else "Unknown",
)
# Check load_model signature
print("\nChecking load_model function...")
try:
sig = inspect.signature(onnx_asr.load_model)
print("load_model signature:", sig)
# Check parameters
print("\nParameters:")
for param_name, param in sig.parameters.items():
print(f" {param_name}: {param}")
except Exception as e:
print(f"Error: {e}")
# Try to see if there are session options
print("\nChecking for session options parameter...")
# Let's try to call with extra kwargs
try:
# Try to see what happens with provider_options
import onnxruntime as ort
print("Attempting to create model with custom session options...")
# Check if onnx_asr has any exposed configuration
model = onnx_asr.load_model("nemo-parakeet-tdt-0.6b-v3", quantization="int8")
print("Model loaded successfully")
# Check if model has any session attribute
if hasattr(model, "session"):
print("Model has session attribute")
session = model.session
print(
f"Session options: intra_op_num_threads={session.get_session_options().intra_op_num_threads}"
)
print(
f"Session options: inter_op_num_threads={session.get_session_options().inter_op_num_threads}"
)
else:
print("Model doesn't have direct session access")
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()