[Cache Request] google/gemma-3n-E4B-it

#485
by latchkeyopn - opened

import sagemaker
import boto3
from sagemaker.huggingface import HuggingFace

try:
role = sagemaker.get_execution_role()
except ValueError:
iam = boto3.client('iam')
role = iam.get_role(RoleName='sagemaker_execution_role')['Role']['Arn']

hyperparameters = {
'model_name_or_path':'google/gemma-3n-E4B-it',
'output_dir':'/opt/ml/model'
# add your remaining hyperparameters
# more info here https://github.com/huggingface/transformers/tree/v4.49.0/examples/pytorch/question-answering
}

git configuration to download our fine-tuning script

git_config = {'repo': 'https://github.com/huggingface/transformers.git','branch': 'v4.49.0'}

creates Hugging Face estimator

huggingface_estimator = HuggingFace(
entry_point='run_qa.py',
source_dir='./examples/pytorch/question-answering',
instance_type='ml.p3.2xlarge',
instance_count=1,
role=role,
git_config=git_config,
transformers_version='4.49.0',
pytorch_version='2.5.1',
py_version='py311',
hyperparameters = hyperparameters
)

starting the train job

huggingface_estimator.fit()

latchkeyopn changed discussion status to closed
latchkeyopn changed discussion status to open

Sign up or log in to comment