1docker pull magicunicorn/unicorn-orator:intel-igpu-v1.0
2docker run -p 8885:8880 magicunicorn/unicorn-orator:intel-igpu-v1.0
1import onnxruntime as ort
2import numpy as np
3
4# Load model with Intel iGPU optimization
5providers = [('OpenVINOExecutionProvider', {
6 'device_type': 'GPU',
7 'precision': 'FP16'
8})]
9
10session = ort.InferenceSession('kokoro-v0_19.onnx', providers=providers)
11
12# Run inference
13outputs = session.run(None, {
14 'tokens': phoneme_ids, # Text as phoneme IDs
15 'style': voice_embedding, # 256-dim voice vector
16 'speed': np.array([1.0]) # Speech rate
17})
18
19audio = outputs[0] # 24kHz audio waveform
1# Intel GPU drivers
2sudo apt-get install intel-opencl-icd intel-level-zero-gpu level-zero
3
4# Python packages
5pip install onnxruntime-openvino==1.17.0
6pip install numpy soundfile
1from kokoro_tts import KokoroTTS
2
3tts = KokoroTTS(device='igpu')
4audio = tts.synthesize("Hello world!", voice="af_bella")
1texts = ["First sentence.", "Second sentence."]
2audios = tts.batch_synthesize(texts, voice="am_michael")
1# Blend two voices
2voice_blend = 0.7 * voices['af_bella'] + 0.3 * voices['af_sarah']
3audio = tts.synthesize("Blended voice test", style=voice_blend)
1@software{kokoro_tts_2024,
2 title = {Kokoro TTS v0.19 - Intel iGPU Optimized},
3 author = {Magic Unicorn Unconventional Technology & Stuff Inc},
4 year = {2024},
5 url = {https://huggingface.co/magicunicorn/kokoro-tts-intel}
6}