Orpheus CPP
Installation
pip install orpheus-cpp
You also need to install the llama-cpp-python package separately. This is because llama-cpp-python does not ship pre-built wheels on PyPi.
Don't worry, you can just run one of the following commands:
Linux/Windows
pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
MacOS with Apple Silicon
pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/metal
Usage
Async FastRTC Demo
After installing orpheus-cpp, install fastrtc and run the following command:
python -m orpheus_cpp
Then go to http://localhost:7860 and you should see the demo.
>
Sync TTS
from orpheus_cpp import OrpheusCpp
from scipy.io.wavfile import write
orpheus = OrpheusCpp()
text = "I really hope the project deadline doesn't get moved up again."
# output is a tuple of (sample_rate (24_000), samples (numpy int16 array))
sample_rate, samples = orpheus.tts(text, options={"voice_id": "tara"})
write("output.wav", sample_rate, samples.squeeze())
Streaming Sync
for sample_rate, samples in orpheus.stream_tts_sync(text, options={"voice_id": "tara"}):
write("output.wav", sample_rate, samples.squeeze())
Streaming Async
async for sample_rate, samples in orpheus.stream_tts(text, options={"voice_id": "tara"}):
write("output.wav", sample_rate, samples.squeeze())
Tips
By default, we wait until 1.5 seconds of audio is generated before yielding the first chunk.
This is to ensure smooth audio streaming at the cost of a longer time to first audio.
Depending on your hardware, you can try to reduce the pre_buffer_size to get a faster time to first chunk.
async for sample_rate, samples in orpheus.stream_tts(text, options={"voice_id": "tara", "pre_buffer_size": 0.5}):
write("output.wav", sample_rate, samples.squeeze())
License
orpheus-cpp is distributed under the terms of the MIT license.
Metadata
Release files for orpheus-cpp 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| orpheus_cpp-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Release files / orpheus_cpp-0.0.3-py3-none-any.whl
| Download URL | orpheus_cpp-0.0.3-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85b686335859948ad155bd68435d4ade0832f260e38717e7caa4591bfc3c35b3
|
|
BLAKE2b-256 checksum How to use checksums |
c4d4b9f355a273290e19f98d241170c40d11fd22e231850e2045007b5ba1e94f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|