File size: 715 Bytes
ef46523
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
from autotrain import logger
from autotrain.trainers.common import ALLOW_REMOTE_CODE
from autotrain.trainers.text_generation import LLMTrainingParams, LLMTrainer

def train():
    

    # Define training parameters
    params = LLMTrainingParams(
        model_name="microsoft/phi-4",  # Replace with your model
        data_path="lavita/medical-qa-datasets",
        project_name="phi4-training",
        learning_rate=2e-5,
        num_train_epochs=3,
        batch_size=2,
        fp16=True,
        push_to_hub=True,
        repo_id="hackergeek98/phi4-trained",
    )

    # Initialize and run trainer
    trainer = LLMTrainer(params=params)
    trainer.train()

if __name__ == "__main__":
    train()