Перейти к содержанию

lj1995GPT-SoVITS

GPTSoVITS

Defines both target and prompt languages for GPT-SoVITS zero-shot voice prompting.

Text to speechVoiceHub-nativegptsovitsParameters: 128.9MLanguages: zh, en +3Training: preprocessedLicense: Checkpoint-specific

Parameter metadata: Exact learned-parameter total for VoiceHub's audited native primary graph at the registered default selection; separately loaded auxiliary models are excluded.

Usage

Complete the VoiceHub installation once, then run this repository-authored example. Model pages intentionally contain no package-install command.

This example is maintained against VoiceHub's public API; it is not copied from an upstream demo or package README.

Model-specific path: Defines both target and prompt languages for GPT-SoVITS zero-shot voice prompting.

Inputs and controls: Use the language codes accepted by the selected GPT-SoVITS checkpoint and an exact prompt transcript.

from pathlib import Path

from voicehub import AutoModelForTextToSpeech, TTSGenerationConfig

REFERENCE_AUDIO = Path("reference.wav")
REFERENCE_TEXT = "The reference transcript must exactly match the authorized audio."
if not REFERENCE_AUDIO.is_file():
    raise FileNotFoundError(REFERENCE_AUDIO)

model = AutoModelForTextToSpeech.from_pretrained(
    'lj1995/GPT-SoVITS',
    model_type='gptsovits',
    device="cuda",
    lazy_load=True,
)
output = model.generate(
    'VoiceHub keeps model integrations explicit and reproducible.',
    generation_config=TTSGenerationConfig(
        seed=42,
        output_file=Path("output.wav"),
    ),
    text_language="en",
    speaker_audio_path=str(REFERENCE_AUDIO),
    prompt_language="en",
    prompt_text=REFERENCE_TEXT,
    text_split_method="cut5",
)
print(output.file_path, output.sample_rate, output.metadata)

Use authorized recordings. Verify hardware needs and pin a revision in production.

Overview

gptsovits is a VoiceHub text to speech integration. This page is generated from its registry contract. Open the gptsovits Colab notebook.

Property Value
Task Text to speech
Architecture gptsovits
Runtime VoiceHub-native
Languages zh, en, ja, ko, yue
Capabilities text-to-speech, voice-cloning, multilingual, fine-tuning, safetensors, voicehub-native, native-runtime, preprocessed-training, gpt-sovits-v1, gpt-sovits-v2, gpt-sovits-v2-pro, gpt-sovits-v2-pro-plus, prepared-pro-speaker-conditioning, variant-aware-safetensors-export
Reusable components —
Normalized output TTSOutput

Language support

Supported language abbreviations

zh, en, ja, ko, yue

Korean and Cantonese support applies to V2 and later variants.

Paper and GitHub

Configuration

Load configuration without constructing the model:

from voicehub import AutoConfig

config = AutoConfig.for_model('gptsovits')
print(config.model_type)
Property Value
Canonical model type gptsovits
Configuration class GPTSoVITSConfig
Architecture class GPTSoVITSForTextToSpeech

Processing

Create the registered processor without allocating model weights:

from voicehub import AutoProcessor

processor = AutoProcessor.from_pretrained(
    'lj1995/GPT-SoVITS',
    model_type='gptsovits',
)
print(type(processor).__name__)

Inference

The Usage example returns TTSOutput through AutoModelForTextToSpeech.

Input and output contract

Property Value
Readiness preprocessed
Data architecture hybrid
Sample rate 32,000 Hz
Contract getter get_tts_dataset_spec('gptsovits')
Variant Required fields One of Boundary Other rules
s1-preprocessed phoneme_ids, semantic_ids, bert_features — Prepared —
s2-preprocessed ssl_features, spectrogram, audio_values, phoneme_ids — Prepared —
s2-pro-preprocessed ssl_features, spectrogram, audio_values, phoneme_ids, speaker_embedding — Prepared —

Multi-component language-model, diffusion, acoustic, or GAN data. See the data workflow.

Training and optimization

Use available_optimization_passes() to discover reversible public passes. Unsupported runtime or hardware fails closed before mutation.

Training contract

Property Value
Support preprocessed
Family composite
Recipe adversarial
Default phase s1
Training checkpoint lj1995/GPT-SoVITS
Native training graph yes
Phase Kind Components Required inputs Loss keys
s1 objective training_model.s1 phoneme_ids, phoneme_lengths, semantic_ids, semantic_lengths, bert_features loss
s2_generator generator training_model.s2.generator ssl_features, spectrogram, spectrogram_lengths, audio_values, phoneme_ids, phoneme_lengths loss
s2_discriminator discriminator training_model.s2.discriminator ssl_features, spectrogram, spectrogram_lengths, audio_values, phoneme_ids, phoneme_lengths loss

Prepare the exact tensors listed in the data contract before this step. Call model.validate_training_support() first, then follow the training workflow.

Checkpoints, provenance, license, and limitations

Property Value
Default checkpoint lj1995/GPT-SoVITS
Hugging Face ID lj1995/GPT-SoVITS
Repository availability verified through the Hugging Face model API on 2026-08-11; pin a revision before production use.
Checkpoint status Registry default; pin an immutable revision for production and reproducible evidence
Optional dependency extra Core package
Hardware and runtime Usage selects cuda; verify checkpoint-specific requirements
Real-checkpoint evidence Release evidence; a registry default alone is not execution evidence
Implementation voicehub.models.gptsovits.modeling_gptsovits.GPTSoVITSForTextToSpeech
Configuration voicehub.models.gptsovits.configuration_gptsovits.GPTSoVITSConfig
Source provenance voicehub/models/gptsovits/source/SOURCE.json
License Checkpoint-specific

No VoiceHub-specific license override is registered. Verify the checkpoint and upstream source terms before use.

Confirm the checkpoint revision, access terms, provenance, and license.

Limitations

  • No integration-specific checkpoint limitation is registered. Verify the selected checkpoint revision and its documented runtime requirements.
  • Validate memory, precision, and optional dependencies on the target system.
  • Public optimizations fail closed when the runtime or hardware cannot satisfy their validation contract; an unavailable pass is not reported as applied.
  • Contract tests do not replace the linked released-checkpoint evidence.

Public API

Use the stable configuration, processor, and task-model facades below.

Configuration

GPTSoVITSConfig

View source

GPTSoVITSConfig(**config_kwargs)

Parameters

  • **config_kwargs — Configuration fields validated by GPTSoVITSConfig.

Model

GPTSoVITSForTextToSpeech

View source

AutoModelForTextToSpeech.from_pretrained(
    pretrained_model_name_or_path,
    *,
    model_type='gptsovits',
    config=None,
    **model_kwargs,
)

Parameters

  • pretrained_model_name_or_path — Hub ID or compatible local directory.
  • model_type — Canonical model type; use 'gptsovits'.
  • config — Optional preloaded GPTSoVITSConfig instance.
  • **model_kwargs — Model-specific loading arguments.
from voicehub import get_model_spec

spec = get_model_spec('gptsovits')
print(spec.display_name, spec.task.value)
Purpose Public object
Discover get_model_spec('gptsovits')
Load and run AutoModelForTextToSpeech
Configure GPTSoVITSConfig
Process AutoProcessor
Model implementation GPTSoVITSForTextToSpeech
Normalized output TTSOutput
Training contract get_training_spec('gptsovits')
Optimization lifecycle available_optimization_passes, apply_optimization_plan, optimization_manifest, restore_optimization_plan

See all model guides, inference, and the training matrix.