Skip to content

Commit

Permalink
improved sagemaker documentation for git_config and examples (hugging…
Browse files Browse the repository at this point in the history
…face#10966)

* improved branch usage

* fixed grammar and comma
  • Loading branch information
philschmid authored Mar 30, 2021
1 parent 83d38c9 commit e3c8443
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/source/sagemaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ huggingface_estimator = HuggingFace(
transformers_version='4.4.2',
pytorch_version='1.6.0',
py_version='py36',
hyperparameters = hyperparameters
hyperparameters = hyperparameters,
distribution = distribution
)
```
Expand Down Expand Up @@ -323,7 +323,9 @@ huggingface_estimator = HuggingFace(

### Git Repository

When you create a `HuggingFace` Estimator, you can specify a [training script that is stored in a GitHub repository](https://sagemaker.readthedocs.io/en/stable/overview.html#use-scripts-stored-in-a-git-repository) as the entry point for the estimator, so that you don’t have to download the scripts locally. If Git support is enabled, then `entry_point` and `source_dir` should be relative paths in the Git repo if provided.
When you create a `HuggingFace` Estimator, you can specify a [training script that is stored in a GitHub repository](https://sagemaker.readthedocs.io/en/stable/overview.html#use-scripts-stored-in-a-git-repository) as the entry point for the estimator, so that you don’t have to download the scripts locally. If Git support is enabled, the `entry_point` and `source_dir` should be relative paths in the Git repo if provided.

If you are using `git_config` to run the [🤗 Transformers examples scripts](https://github.com/huggingface/transformers/tree/master/examples) keep in mind that you need to configure the right `'branch'` for you `transformers_version`, e.g. if you use `transformers_version='4.4.2` you have to use `'branch':'v4.4.2'`.

As an example to use `git_config` with an [example script from the transformers repository](https://github.com/huggingface/transformers/tree/master/examples/text-classification).

Expand All @@ -333,7 +335,7 @@ _Tip: define `output_dir` as `/opt/ml/model` in the hyperparameter for the scrip

```python
# configure git settings
git_config = {'repo': 'https://github.com/huggingface/transformers.git','branch': 'master'}
git_config = {'repo': 'https://github.com/huggingface/transformers.git','branch': 'v4.4.2'} # v4.4.2 is referring to the `transformers_version you use in the estimator.

# create the Estimator
huggingface_estimator = HuggingFace(
Expand Down

0 comments on commit e3c8443

Please sign in to comment.