Training the model locally