Skip to content

Instantly share code, notes, and snippets.

View sanjayshreeyans's full-sized avatar

Sanjay Javangula sanjayshreeyans

  • Bentonville, AR
  • 05:58 (UTC -05:00)
View GitHub Profile
@sanjayshreeyans
sanjayshreeyans / Phoneme.py
Created July 2, 2025 23:10
Kokorko ONNX Timestamped - Phoneme Level Timestamps
from pathlib import Path
from misaki import en
import numpy as np
import onnxruntime
def tokenize(phonemes):
"""
Converts a list of phonemes (strings) into a list of their corresponding
integer IDs based on the global VOCAB dictionary.
Filters out any phonemes not found in the vocabulary.