Skip to main content

No project description provided

Project description

Orpheus CPP

PyPI - Version PyPI - Python Version


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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orpheus_cpp-0.0.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file orpheus_cpp-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: orpheus_cpp-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for orpheus_cpp-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc16a40004adef407637c53263c65b89b8c0d18ba89cffd1b7b6d0f63435e99f
MD5 211f5d89c3172f559bffc98468cc882f
BLAKE2b-256 5be7dc675411bd50cf6305d32b4840eb78be6eba66c44582b2b82112101961bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page