tts / train.py
m6011's picture
Update train.py
93097a6 verified
raw
history blame
685 Bytes
from datasets import load_dataset
from transformers import Trainer, TrainingArguments, Tacotron2ForConditionalGeneration
# تحميل البيانات من Hugging Face Datasets
dataset = load_dataset("m6011/sada2022")
najdi_data = dataset.filter(lambda example: example['SpeakerDialect'] == 'Najdi')
# إعداد النموذج والمعالج
model = Tacotron2ForConditionalGeneration.from_pretrained("facebook/tacotron2")
# إعداد التدريب
training_args = TrainingArguments(output_dir="./results", per_device_train_batch_size=16, num_train_epochs=3)
trainer = Trainer(model=model, args=training_args, train_dataset=najdi_data)
# بدء التدريب
trainer.train()