forked from danielcamposramos/Knowledge3D
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_codec_import.py
More file actions
60 lines (45 loc) · 1.69 KB
/
test_codec_import.py
File metadata and controls
60 lines (45 loc) · 1.69 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
55
56
57
58
59
60
#!/usr/bin/env python3
"""Test script to debug codec import issue."""
def main() -> int:
import os
import sys
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
sys.path.insert(
0, "/mnt/arquivos/EchoSystems AI Studios/Knowledge 3D Standard/GitHub/Knowledge3D"
)
print("Step 1: Import numpy")
import numpy as np
print(" ✓ NumPy imported")
print("\nStep 2: Try importing TernaryQuantizer directly")
try:
sys.path.insert(0, "knowledge3d/cranium/codecs/ptx_bindings")
from ternary_quant_binding import TernaryQuantizer
print(" ✓ Direct import works")
quant = TernaryQuantizer()
print(" ✓ Direct initialization works")
except Exception as e:
print(f" ✗ Direct import/init failed: {e}")
print("\nStep 3: Try importing through package")
# Clear the direct imports
if "ternary_quant_binding" in sys.modules:
del sys.modules["ternary_quant_binding"]
try:
from knowledge3d.cranium.codecs.ternary_quantization import quantize_ternary
print(" ✓ Package import works")
except Exception as e:
print(f" ✗ Package import failed: {e}")
import traceback
traceback.print_exc()
print("\nStep 4: Try importing AudioHarmonicGPU")
try:
from knowledge3d.cranium.codecs.ptx_bindings.audio_harmonic_binding import (
AudioHarmonicGPU,
)
print(" ✓ AudioHarmonicGPU import works")
harm = AudioHarmonicGPU()
print(" ✓ AudioHarmonicGPU initialization works")
except Exception as e:
print(f" ✗ AudioHarmonicGPU failed: {e}")
return 0
if __name__ == "__main__":
raise SystemExit(main())