> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-hi/audio-and-voice/zonos-tts.md).

# Zonos TTS Voice Cloning

Zonos द्वारा [Zyphra](https://www.zyphra.com/) यह एक 0.4B-पैरामीटर ओपन-वेट टेक्स्ट-टू-स्पीच मॉडल है जिसे 200K+ घंटे के बहुभाषी स्पीच पर प्रशिक्षित किया गया है। यह केवल 2–30 सेकंड के संदर्भ ऑडियो से शून्य-शॉट वॉइस क्लोनिंग करता है और भावना, बोलने की गति, पिच परिवर्तन और ऑडियो गुणवत्ता पर सूक्ष्म नियंत्रण प्रदान करता है। आउटपुट उच्च-निष्ठा 44 kHz ऑडियो होता है। दो मॉडल वेरिएंट उपलब्ध हैं: ट्रांसफॉर्मर (सर्वोत्तम गुणवत्ता) और हाइब्रिड/मैम्बा (तेज़ इनफ़रेंस)।

**GitHub:** [Zyphra/Zonos](https://github.com/Zyphra/Zonos) **HuggingFace:** [Zyphra/Zonos-v0.1-transformer](https://huggingface.co/Zyphra/Zonos-v0.1-transformer) **लाइसेंस:** Apache 2.0

## प्रमुख विशेषताएँ

* **2–30 सेकंड से वॉइस क्लोनिंग** — किसी फ़ाइन-ट्यूनिंग की आवश्यकता नहीं
* **44 kHz उच्च-निष्ठा आउटपुट** — स्टूडियो-ग्रेड ऑडियो गुणवत्ता
* **भावना नियंत्रण** — 8D वेक्टर के माध्यम से खुशी, उदासी, क्रोध, भय, आश्चर्य, घृणा
* **बोलने की गति और पिच** — स्वतंत्र सूक्ष्म नियंत्रण
* **ऑडियो प्रीफ़िक्स इनपुट** — फुसफुसाहट और अन्य कठिन-से-क्लोन व्यवहार सक्षम करता है
* **बहुभाषी** — अंग्रेजी, जापानी, चीनी, फ्रेंच, जर्मन
* **दो आर्किटेक्चर** — ट्रांसफॉर्मर (गुणवत्ता) और हाइब्रिड/मैम्बा (गति, RTX 4090 पर \~2× रियल-टाइम)
* **Apache 2.0** — व्यक्तिगत और व्यावसायिक उपयोग के लिए मुफ्त

## आवश्यकताएँ

| घटक    | न्यूनतम             | अनुशंसित       |
| ------ | ------------------- | -------------- |
| GPU    | RTX 3080 10 GB      | RTX 4090 24 GB |
| VRAM   | 6 GB (ट्रांसफॉर्मर) | 10 GB+         |
| RAM    | 16 GB               | 32 GB          |
| डिस्क  | 10 GB               | 20 GB          |
| Python | 3.10+               | 3.11           |
| CUDA   | 11.8+               | 12.4           |
| सिस्टम | espeak-ng           | —              |

**Clore.ai सिफारिश:** RTX 3090 (~~$0.30–1.00/दिन) आरामदायक हेडरूम के लिए। RTX 4090 (~~$0.50–2.00/दिन) हाइब्रिड मॉडल और सबसे तेज़ इनफ़रेंस के लिए।

## इंस्टॉलेशन

```bash
# सिस्टम निर्भरता स्थापित करें
apt-get install -y espeak-ng

# क्लोन और इंस्टॉल करें
git clone https://github.com/Zyphra/Zonos.git
cd Zonos
pip install -e .

# हाइब्रिड मॉडल के लिए (Ampere+ GPU की आवश्यकता, यानी RTX 3000 सीरीज़ या नया)
pip install -e ".[compile]"

# सत्यापित करें
python -c "from zonos.model import Zonos; print('Zonos ready')"
```

## त्वरित प्रारम्भ

```python
import torch
import torchaudio
from zonos.model import Zonos
from zonos.conditioning import make_cond_dict

# मॉडल लोड करें (पहली बार चलाने पर वेट्स डाउनलोड होते हैं)
model = Zonos.from_pretrained("Zyphra/Zonos-v0.1-transformer", device="cuda")

# वॉइस क्लोनिंग के लिए संदर्भ ऑडियो लोड करें
wav, sr = torchaudio.load("reference_speaker.wav")
speaker = model.make_speaker_embedding(wav, sr)

# कंडीशनिंग बनाएं
cond_dict = make_cond_dict(
    text="Clore.ai से नमस्ते! यह एक वॉइस क्लोनिंग डेमो है।",
    speaker=speaker,
    language="en-us",
)
conditioning = model.prepare_conditioning(cond_dict)

# जनरेट करें
torch.manual_seed(42)
codes = model.generate(conditioning)
wavs = model.autoencoder.decode(codes).cpu()

torchaudio.save("output.wav", wavs[0], model.autoencoder.sampling_rate)
print(f"Saved output.wav at {model.autoencoder.sampling_rate} Hz")
```

## उपयोग के उदाहरण

### इमोशन नियंत्रण

Zonos एक 8-आयामी भावना वेक्टर स्वीकार करता है: `[खुशी, उदासी, घृणा, भय, आश्चर्य, क्रोध, अन्य, तटस्थ]`.

```python
import torch
import torchaudio
from zonos.model import Zonos
from zonos.conditioning import make_cond_dict

model = Zonos.from_pretrained("Zyphra/Zonos-v0.1-transformer", device="cuda")

wav, sr = torchaudio.load("speaker_ref.wav")
speaker = model.make_speaker_embedding(wav, sr)

text = "मैं विश्वास नहीं कर सकता कि आज क्या हुआ!"

emotions = {
    "happy":   [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
    "sad":     [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
    "angry":   [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
    "fearful": [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0],
    "neutral": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
}

for name, emo_vec in emotions.items():
    cond_dict = make_cond_dict(
        text=text,
        speaker=speaker,
        language="en-us",
        emotion=torch.tensor(emo_vec).unsqueeze(0),
    )
    conditioning = model.prepare_conditioning(cond_dict)
    codes = model.generate(conditioning)
    audio = model.autoencoder.decode(codes).cpu()
    torchaudio.save(f"emotion_{name}.wav", audio[0], model.autoencoder.sampling_rate)
    print(f"Generated: {name}")
```

### बोलने की गति और पिच नियंत्रण

```python
import torch
import torchaudio
from zonos.model import Zonos
from zonos.conditioning import make_cond_dict

model = Zonos.from_pretrained("Zyphra/Zonos-v0.1-transformer", device="cuda")

wav, sr = torchaudio.load("speaker_ref.wav")
speaker = model.make_speaker_embedding(wav, sr)

# धीमा और शांत
cond_slow = make_cond_dict(
    text="धीरे लीजिए। बिलकुल भी जल्दबाज़ी नहीं है।",
    speaker=speaker,
    language="en-us",
    speaking_rate=torch.tensor([8.0]),   # कम = धीमा
    pitch_std=torch.tensor([20.0]),      # कम = अधिक एकसुर
)
codes = model.generate(model.prepare_conditioning(cond_slow))
audio = model.autoencoder.decode(codes).cpu()
torchaudio.save("slow_calm.wav", audio[0], model.autoencoder.sampling_rate)

# तेज़ और ऊर्जावान
cond_fast = make_cond_dict(
    text="जल्दी करो! हमें अभी भागना होगा!",
    speaker=speaker,
    language="en-us",
    speaking_rate=torch.tensor([22.0]),  # अधिक = तेज़
    pitch_std=torch.tensor([80.0]),      # अधिक = अधिक अभिव्यक्तिपूर्ण
)
codes = model.generate(model.prepare_conditioning(cond_fast))
audio = model.autoencoder.decode(codes).cpu()
torchaudio.save("fast_energetic.wav", audio[0], model.autoencoder.sampling_rate)
```

### Gradio वेब इंटरफेस

```bash
cd Zonos
python gradio_interface.py
# या uv के साथ:
# uv run gradio_interface.py
```

पोर्ट एक्सपोज़ करें `7860/http` अपने Clore.ai ऑर्डर में और खोलें `http_pub` UI तक पहुँचने के लिए URL।

## Clore.ai उपयोगकर्ताओं के लिए सुझाव

* **मॉडल चयन** — सर्वोत्तम गुणवत्ता के लिए ट्रांसफॉर्मर, \~2× तेज़ इनफ़रेंस के लिए हाइब्रिड (RTX 3000+ GPU आवश्यक)
* **संदर्भ ऑडियो** — 10–30 सेकंड की साफ़ स्पीच सबसे अच्छे परिणाम देती है; छोटे क्लिप (2–5s) काम करते हैं लेकिन कम निष्ठा के साथ
* **Docker सेटअप** — उपयोग करें `pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime`, जोड़ें `apt-get install -y espeak-ng` स्टार्टअप में
* **पोर्ट मैपिंग** — एक्सपोज़ करें `7860/http` Gradio UI के लिए, `8000/http` API सर्वर के लिए
* **सीड नियंत्रण** — सेट करें `torch.manual_seed()` पुनरुत्पादन योग्य आउटपुट के लिए जनरेशन से पहले
* **ऑडियो गुणवत्ता पैरामीटर** — साफ़ आउटपुट के लिए `audio_quality` कंडीशनिंग फ़ील्ड के साथ प्रयोग करें

## समस्याओं का निवारण

| समस्या                         | समाधान                                                                                              |
| ------------------------------ | --------------------------------------------------------------------------------------------------- |
| `espeak-ng नहीं मिला`          | चलाएँ `apt-get install -y espeak-ng` (फ़ोनेमीकरण के लिए आवश्यक)                                     |
| `CUDA में आउट ऑफ मेमोरी`       | ट्रांसफॉर्मर मॉडल का उपयोग करें (हाइब्रिड से छोटा); प्रति कॉल टेक्स्ट की लंबाई घटाएँ                |
| हाइब्रिड मॉडल विफल होता है     | Ampere+ GPU (RTX 3000 श्रृंखला या नया) और की आवश्यकता `pip install -e ".[compile]"`                 |
| क्लोन की गई आवाज़ अजीब लगती है | 15–30s का लंबा संदर्भ क्लिप उपयोग करें जिसमें स्पष्ट स्पीच और न्यूनतम बैकग्राउंड शोर हो             |
| धीमी जनरेशन                    | ट्रांसफॉर्मर के लिए सामान्य (\~0.5× रियल-टाइम); हाइब्रिड RTX 4090 पर \~2× रियल-टाइम प्राप्त करता है |
| `ModuleNotFoundError: zonos`   | सुनिश्चित करें कि आपने स्रोत से इंस्टॉल किया है: `cd Zonos && pip install -e .`                     |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-hi/audio-and-voice/zonos-tts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
