Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sagemaker
|
2 |
+
from sagemaker.huggingface import HuggingFace
|
3 |
+
|
4 |
+
# gets role for executing training job
|
5 |
+
role = sagemaker.get_execution_role()
|
6 |
+
hyperparameters = {
|
7 |
+
'model_name_or_path':'MickyMike/0-GPT2SP-datamanagement',
|
8 |
+
'output_dir':'/opt/ml/model'
|
9 |
+
# add your remaining hyperparameters
|
10 |
+
# more info here https://github.com/huggingface/transformers/tree/v4.17.0/examples/pytorch/text-classification
|
11 |
+
}
|
12 |
+
|
13 |
+
# git configuration to download our fine-tuning script
|
14 |
+
git_config = {'repo': 'https://github.com/huggingface/transformers.git','branch': 'v4.17.0'}
|
15 |
+
|
16 |
+
# creates Hugging Face estimator
|
17 |
+
huggingface_estimator = HuggingFace(
|
18 |
+
entry_point='run_glue.py',
|
19 |
+
source_dir='./examples/pytorch/text-classification',
|
20 |
+
instance_type='ml.p3.2xlarge',
|
21 |
+
instance_count=1,
|
22 |
+
role=role,
|
23 |
+
git_config=git_config,
|
24 |
+
transformers_version='4.17.0',
|
25 |
+
pytorch_version='1.10.2',
|
26 |
+
py_version='py38',
|
27 |
+
hyperparameters = hyperparameters
|
28 |
+
)
|
29 |
+
|
30 |
+
# starting the train job
|
31 |
+
huggingface_estimator.fit()
|