File size: 467 Bytes
ad81a11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import sys
import torch
from tokenizer import PhonologicalTokenizer
def main():
if len(sys.argv) != 2:
print("Usage: python inference.py path/to/audio.wav")
sys.exit(1)
wav_path = sys.argv[1]
device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = PhonologicalTokenizer(device=device)
with torch.no_grad():
clusters = tokenizer(wav_path)
print(clusters)
if __name__ == "__main__":
main()
|