Finetune โมเดลโค้ด GitHub : https://github.com/VYNCX/finetune-local-vits

Finetune-colab เทรนโมเดลเสียงด้วยตัวเองบน Google Colab

ใช้งาน บน local คอมพิวเตอร์ https://github.com/VYNCX/VachanaTTS

การใช้งาน :

import torch
from transformers import VitsTokenizer, VitsModel, set_seed
import scipy

tokenizer = VitsTokenizer.from_pretrained("VIZINTZOR/VIZINTZOR/MMS-TTS-THAI-FEMALEV2",cache_dir="./mms")
model = VitsModel.from_pretrained("VIZINTZOR/VIZINTZOR/MMS-TTS-THAI-FEMALEV2",cache_dir="./mms")

inputs = tokenizer(text="สวัสดีค่ะ นี่คือเสียงพูดภาษาไทย", return_tensors="pt")

set_seed(456)  # make deterministic

with torch.no_grad():
   outputs = model(**inputs)

waveform = outputs.waveform[0]

# Convert PyTorch tensor to NumPy array
waveform_array = waveform.numpy()

scipy.io.wavfile.write("techno_output.wav", rate=model.config.sampling_rate, data=waveform_array)
Downloads last month
11
Safetensors
Model size
86.4M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.