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

gefragt vor 2 Monaten152 Aufrufe
1 Antwort
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
beantwortet vor 2 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten
  • @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?

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen