inference package for the OSAL models
**OSAL** This is an extension api for the ease access of the models we've developed. All the models can be accessed on the huggingface hub
## Features
- **High-Quality Synthesis**: Generates natural-sounding speech.
- **Multi-Lingual Support**: Create and manage multiple TTS models for different languages simultaneously in the same application.
- **High-Performance**: Fast C++ backend with multi-threading support.
- **GPU Acceleration**: Offload model layers to the GPU for even faster performance.
- **Offline Inference**: After the initial model download, no internet connection is required.
## Prerequisites
To download the required TTS models, you need a **Hugging Face Hub API Token**.
1. If you don't have one, create a Hugging Face account here.
2. Navigate to your account settings and find the "Access Tokens" page, or go directly to
huggingface.co.
3. Create a new token with at least `read` permissions.
## Installation
You can install Orpheus TTS via pip:
```bash
git clone
github.com
cd OSAL
pip install -r requirements.txt
```
## Quick Start: Multiple Language Instances
We recommend storing your token as an environment variable for security.
```bash
export HUGGING_FACE_TOKEN="hf_YourTokenGoesHere"
```
Now, you can run the following Python code to create both English and Luganda synthesizers:
```python
import os
from osal import tts
# 1. Get Hugging Face Token ---
hf_token = os.environ.get("HUGGING_FACE_TOKEN")
if not hf_token:
raise ValueError("Hugging Face token not found. Please set the HUGGING_FACE_TOKEN environment variable.")
# 2. Create TTS Instances for Different Languages ---
# This will download the models on the first run.
print("Initializing English TTS model...")
tts_en = tts.OrpheusCpp(huggingface_token=hf_token, lang="en")
# Other languages
print("\nInitializing Luganda TTS model with GPU acceleration...")
tts_lug = tts.OrpheusCpp(
huggingface_token=hf_token,
lang="lug",
n_gp …