How to set up a training job in sagemaker ?

0

I'm following a blog/sample here - https://kedion.medium.com/fine-tuning-nlp-models-with-hugging-face-f92d55949b66. How can i set up something similar with just sagemaker and using aws cli? (sample code below from the example ) . in the example, it uses distilbert-base-uncased model and it is loaded via this code -> tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")

where does the model gets downloaded from and if one were to set up similar training job via boto3/cli, can we pass model location somewhere in a s3 bucket?

# Importing necessary tools
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
from datasets import load_dataset
import tensorflow as tf
import numpy as np

# Loading our dataset
tweet_dataset = load_dataset(path="tweet_eval", name="emotion")

# Instantiating our DistilBERT tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
model = TFAutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=4

demandé il y a 2 mois153 vues
1 réponse
1

Hi clouduser,

If you are looking to set up something similar with just SageMaker and using the AWS CLI, here is an article that shows how you can directly set up a training job using a Hugging Face model and Amazon SageMaker.

Here is another example setup with PyTorch Training Jobs.

Here is another example setup with TensorFlow Training jobs.

I would recommend following one of these three blogs to set up your Amazon SageMaker training job based on which model you decide to go with.

AWS
autrin
répondu il y a 2 mois
profile picture
EXPERT
vérifié il y a 2 mois
  • @autrin - thanks . if i want to fine tune a model , "distilbert-base-uncased" , in my case. how to set up a training/fine tuning job in sagemaker?

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions