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

已提问 2 个月前152 查看次数
1 回答
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
已回答 2 个月前
profile picture
专家
已审核 2 个月前
  • @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?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则