Drama3
- class ctranslate2.models.Drama3
Experimental offline text-to-speech synthesis using model replicas.
Inherits from:
pybind11_builtins.pybind11_objectAttributes:
Methods:
- __init__(model_path: str, intra_threads: int = 8, compute_type: str = 'default', device: str = 'cpu', device_index: int = 0, inter_threads: int = 1, max_queued_batches: int = 0) None
Loads a converted Drama3 model with a pool of execution replicas.
- Parameters
model_path – Local CTranslate2 model directory.
intra_threads – Positive number of CPU threads per replica.
compute_type – CTranslate2 compute type, subject to backend support.
device – Execution device: cpu, cuda (NVIDIA or ROCm), or auto.
device_index – Zero-based GPU index; use 0 for CPU.
inter_threads – Positive number of independent execution replicas. CPU checkpoint weights are shared; GPU caches are private to each replica.
max_queued_batches – Maximum queued requests; 0 uses four per replica, a negative value allows an unlimited queue.
- generate(prompt_rows: numpy.ndarray[numpy.int32], max_frames: int = 512, prefill_chunk_size: int = 16, temperature: float = 0.800000011920929, top_k: int = 30, top_p: float = 0.800000011920929, seed: int = 0, greedy: bool = False, asynchronous: bool = False) object
Generates offline speech on the first available replica.
- Parameters
prompt_rows – Contiguous INT32 [rows, 11]: text IDs and ten codec columns.
max_frames – Maximum generated frames (2048 samples at 44100 Hz each).
prefill_chunk_size – Prompt processing chunk size.
temperature – Positive sampling temperature.
top_k – Positive sampling candidate count.
top_p – Sampling probability threshold in (0, 1].
seed – Per-request random seed.
greedy – Use diagnostic greedy decoding.
asynchronous – Return a Drama3ResultAsync without waiting for generation.
- Returns
Drama3Result, or Drama3ResultAsync when asynchronous=True. Results expose mono FLOAT32 audio, INT32 codes [frames, 10], sample_rate, finish_reason (eos or length), and timings. Mapping-style access remains supported.
- generate_batch(prompts: list[numpy.ndarray[numpy.int32]], max_frames: int = 512, prefill_chunk_size: int = 16, temperature: float = 0.800000011920929, top_k: int = 30, top_p: float = 0.800000011920929, seed: int = 0, greedy: bool = False, asynchronous: bool = False) object
Schedules independent prompts across the replica pool in input order. Options match generate. Returns a list of Drama3Result objects, or Drama3ResultAsync objects when asynchronous=True. Each prompt uses its own sequence state and the supplied seed; kernels process one sequence.
- property compute_type
Resolved computation type used for execution.
- property device
Device used for execution.
- property device_index
Device IDs where this model executes.
- property num_active_batches
- property num_queued_batches
- property num_replicas