Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
de1d337
Enable Llama2 70B to run with hqt on single card (#50)
Yantom1 Feb 20, 2024
23da729
Add ControlNet Pipeline (#585)
nngokhale Jan 30, 2024
6680add
Fix tests (#669)
ssarkar2 Jan 30, 2024
dbee23b
Add Flan T5 to model table (#677)
regisss Feb 1, 2024
0014f9d
Update dev version (#678)
regisss Feb 1, 2024
dd22d63
Change capture logic for HPU graphs in Diffusers pipelines (#679)
regisss Feb 2, 2024
48840fb
Update llama-7b command to include eval (#665)
jiminha Feb 2, 2024
4f8b2d2
Added check if reuse_cache supported by selected model_type (#675)
iermolae Feb 2, 2024
707803f
Update examples (#682)
regisss Feb 2, 2024
274d459
Add FSDP test to Gaudi2 CI (#683)
regisss Feb 2, 2024
25de760
Bring back workaround for Falcon with SynapseAI 1.13 (#685)
regisss Feb 3, 2024
8850c37
Update examples (#686)
regisss Feb 3, 2024
7ae066e
Fix version check when console output is disabled (#688)
vidyasiv Feb 7, 2024
2332b87
Patch for Gaudi Text-Generation Pipeline (#690)
sjagtap1803 Feb 7, 2024
ade04fc
pt22 roberta fix (#701)
MohitIntel Feb 11, 2024
0743a19
Add PPO and stack_llama support (#615)
sywangyi Feb 11, 2024
e67d875
Updated requirements for image-classification samples: datasets>=2.14…
alekseyfa Feb 11, 2024
1b1d162
Update example diff file for image classification (#703)
regisss Feb 12, 2024
c147134
Upgrade to Transformers 4.37 (#651)
regisss Feb 12, 2024
1ccbc4b
Add instruction in README to checkout latest stable release (#705)
regisss Feb 12, 2024
cc76cc7
Update diff file (#706)
regisss Feb 13, 2024
f28bd06
To fix LLAMA-V2-70B-FT-HF (8x) for eager mode (#709)
mkumargarg Feb 14, 2024
91156c5
Fix Llama initialization
regisss Feb 14, 2024
65f2d0b
Revert "Fix Llama initialization"
regisss Feb 14, 2024
47577ab
Adding a flag whether to save checkpoint or not in run_clm.py (#711)
yeonsily Feb 14, 2024
a094042
Pin Accelerate (#714)
regisss Feb 15, 2024
984709b
Change for R1.10.2 (#719)
libinta Feb 17, 2024
5807ef8
Fix Llama initialization (#712)
regisss Feb 17, 2024
1ed6904
Enable torch_compile mode for distributed (#659)
kalyanjk Feb 19, 2024
22fa9d7
Small `test_text_generation_example.py` refacto (#725)
regisss Feb 19, 2024
c81b621
Add optimization for blip text model generation (#653)
sywangyi Feb 20, 2024
6c33176
Update README, add PPO support (#721)
sywangyi Feb 20, 2024
24a76f2
Update the Mistral model naming (#726)
yafshar Feb 20, 2024
4cc625f
Fix beamsearch crash and incorrect output (#627)
sywangyi Feb 20, 2024
72301f9
Changing backend name (#708)
Feb 20, 2024
63d82c2
Update ppo_trainer.py (#718)
skaulintel Feb 21, 2024
14f7750
Update example diff files (#730)
regisss Feb 22, 2024
ccc91ce
Update latest stable release version in README (#734)
regisss Feb 23, 2024
cd7f9f5
Enable internal kv bucket in llama (#720)
xt574chen Feb 23, 2024
f1ecd6e
Add seed in sft example, make sft result reproducable (#735)
sywangyi Feb 23, 2024
410a07f
Update example diff files
regisss Feb 25, 2024
5432bc9
Fix translation models (#710)
vidyasiv Feb 26, 2024
d4ac144
Adding a flag whether to save checkpoint or not in run_lora_clm.py (#…
yeonsily Feb 27, 2024
29a3687
Refactor and update CI for encoder-decoders (#742)
regisss Feb 27, 2024
1facf71
SDXL fine tuning (#667)
dsocek Feb 27, 2024
9df7a87
Make style for ruff v0.3
regisss Mar 1, 2024
17d5c71
Enable Mixtral-8x7B (#739)
Mar 1, 2024
5699b75
Support speech recognition with whisper models and seq2seq. (#704)
emascarenhas Mar 2, 2024
0fdbd76
Update example diff files
regisss Mar 2, 2024
44d5572
Fix throughput calculation for diffusion models (#715)
skavulya Mar 2, 2024
5748277
Fix command in speech recognition example README
regisss Mar 2, 2024
40e3262
Update CI baselines (#749)
regisss Mar 2, 2024
ea71b50
Fix crash in llama mode in llava image-to-text generation (#755)
sywangyi Mar 4, 2024
d2b8cd0
Update comment added in #507
regisss Mar 5, 2024
98cb8e5
Update Mixtral-8x7B fp8 hqt example (#756)
Mar 5, 2024
2e0e3ce
Controlnet training (#650)
vidyasiv Mar 7, 2024
3cfd71f
Fix `get_dtype` and `convert_into_dtypes` (#769)
regisss Mar 7, 2024
2f18086
Override sdpa option in Gaudi (#771)
jiminha Mar 7, 2024
e6ccd26
Fix Llama-70B-FSDP model loading issue (#752)
hlahkar Mar 7, 2024
08512d0
Expose Llama Fused OPs control from run_lora_clm.py (#751)
hlahkar Mar 7, 2024
125a6b5
Add image-to-text and visual question answering example (#738)
sywangyi Mar 7, 2024
569b4d5
Fixing tests by making static_shapes False (#778)
Mar 10, 2024
2fdc24e
stylize code
HolyFalafel Mar 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/slow_tests_gaudi2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,37 @@ jobs:
--ipc=host \
vault.habana.ai/gaudi-docker/1.14.0/ubuntu22.04/habanalabs/pytorch-installer-2.1.1:latest \
/bin/bash tests/ci/slow_tests_deepspeed.sh
fsdp:
name: Test FSDP models
if: ${{ !cancelled() && (success() || failure()) }}
needs:
- deepspeed # run the job when the previous test job is done
runs-on: [self-hosted, linux, x64, gaudi2]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Pull image
run: |
docker pull vault.habana.ai/gaudi-docker/1.14.0/ubuntu22.04/habanalabs/pytorch-installer-2.1.1:latest
- name: Run tests
run: |
docker run \
-v $PWD:/root/workspace \
--workdir=/root/workspace \
--runtime=habana \
-e HABANA_VISIBLE_DEVICES=all \
-e OMPI_MCA_btl_vader_single_copy_mechanism=none \
-e GAUDI2_CI=1 \
--cap-add=sys_nice \
--net=host \
--ipc=host \
vault.habana.ai/gaudi-docker/1.14.0/ubuntu22.04/habanalabs/pytorch-installer-2.1.1:latest \
make slow_tests_fsdp
multi-card:
name: Test multi-card models
if: ${{ !cancelled() && (success() || failure()) }}
needs:
- deepspeed # run the job when the previous test job is done
- fsdp # run the job when the previous test job is done
runs-on: [self-hosted, linux, x64, gaudi2]
steps:
- name: Checkout
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ REAL_CLONE_URL = $(if $(CLONE_URL),$(CLONE_URL),$(DEFAULT_CLONE_URL))

# Run code quality checks
style_check: clean
pip install -U pip ruff
ruff check . setup.py
ruff format --check . setup.py

style: clean
pip install -U pip ruff
ruff check . setup.py --fix
ruff format . setup.py

Expand Down Expand Up @@ -53,13 +55,20 @@ slow_tests_deepspeed: test_installs
python -m pytest tests/test_examples.py -v -s -k "deepspeed"

slow_tests_diffusers: test_installs
python -m pip install git+https://github.com/huggingface/diffusers.git
python -m pytest tests/test_diffusers.py -v -s -k "test_no_"
python -m pytest tests/test_diffusers.py -v -s -k "test_textual_inversion"
python -m pip install peft==0.7.0
python -m pytest tests/test_diffusers.py -v -s -k "test_train_text_to_image_"
python -m pytest tests/test_diffusers.py -v -s -k "test_train_controlnet"

# Run text-generation non-regression tests
slow_tests_text_generation_example: test_installs
python -m pip install git+https://github.com/HabanaAI/DeepSpeed.git@1.14.0
python -m pytest tests/test_text_generation_example.py tests/test_encoder_decoder_text_summarization.py -v -s --token $(TOKEN)
python -m pytest tests/test_text_generation_example.py tests/test_encoder_decoder.py -v -s --token $(TOKEN)

slow_tests_fsdp: test_installs
python -m pytest tests/test_fsdp_examples.py -v -s

# Check if examples are up to date with the Transformers library
example_diff_tests: test_installs
Expand Down Expand Up @@ -109,4 +118,3 @@ clean:

test_installs:
python -m pip install .[tests]
python -m pip install git+https://github.com/huggingface/accelerate.git
54 changes: 35 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,45 @@ Check out [this blog post about BERT pre-training](https://huggingface.co/blog/p
If you are not familiar with HPUs and would like to know more about them, we recommend you take a look at [our conceptual guide](https://huggingface.co/docs/optimum/habana/concept_guides/hpu).


## Install
To install the latest stable release of this package:
## Install the library and get example scripts

```bash
pip install --upgrade-strategy eager optimum[habana]
```
### Option 1: Use the latest stable release

The `--upgrade-strategy eager` option is needed to ensure `optimum-habana` is upgraded to the latest stable release.

> To use DeepSpeed on HPUs, you also need to run the following command:
To install the latest stable release of this package
>```bash
>pip install git+https://github.com/HabanaAI/DeepSpeed.git@1.14.0
>pip install --upgrade-strategy eager optimum[habana]
>```

Optimum Habana is a fast-moving project, and you may want to install it from source:
The `--upgrade-strategy eager` option is needed to ensure `optimum-habana` is upgraded to the latest stable release.

To use the example associated with the latest stable release, run:
> ```
> git clone https://github.com/huggingface/optimum-habana
> cd optimum-habana && git checkout v1.10.4
> ```
> with `v1.10.4` the version number of this release.

### Option 2: Use the latest main branch under development

Optimum Habana is a fast-moving project, and you may want to install it from source and get the latest scripts :

```bash
pip install git+https://github.com/huggingface/optimum-habana.git
git clone https://github.com/huggingface/optimum-habana
```

Last but not least, don't forget to install the requirements for every example:
## Install dependencies

```bash
cd <example-folder>
pip install -r requirements.txt
```
To use DeepSpeed on HPUs, you also need to run the following command:
>```bash
>pip install git+https://github.com/HabanaAI/DeepSpeed.git@1.14.0
>```

To install the requirements for every example:
>```bash
>cd <example-folder>
>pip install -r requirements.txt
>```


## How to use it?
Expand Down Expand Up @@ -168,14 +181,16 @@ The following model architectures, tasks and device distributions have been vali
| CodeGen | | <div style="text-align:left"><li>Single card</li></div> | <li>[text generation](https://github.com/huggingface/optimum-habana/tree/main/examples/text-generation)</li> |
| MPT | | <div style="text-align:left"><li>Single card</li></div> | <li>[text generation](https://github.com/huggingface/optimum-habana/tree/main/examples/text-generation)</li> |
| Mistral | | <div style="text-align:left"><li>Single card</li></div> | <li>[text generation](https://github.com/huggingface/optimum-habana/tree/main/examples/text-generation)</li> |
| T5 | :heavy_check_mark: | :heavy_check_mark: | <li>[summarization](https://github.com/huggingface/optimum-habana/tree/main/examples/summarization)</li><li>[translation](https://github.com/huggingface/optimum-habana/tree/main/examples/translation)</li><li>[question answering](https://github.com/huggingface/optimum-habana/tree/main/examples/question-answering#fine-tuning-t5-on-squad20)</li> |
| Mixtral | | <div style="text-align:left"><li>Single card</li></div> | <li>[text generation](https://github.com/huggingface/optimum-habana/tree/main/examples/text-generation)</li> |
| T5 / Flan T5 | :heavy_check_mark: | :heavy_check_mark: | <li>[summarization](https://github.com/huggingface/optimum-habana/tree/main/examples/summarization)</li><li>[translation](https://github.com/huggingface/optimum-habana/tree/main/examples/translation)</li><li>[question answering](https://github.com/huggingface/optimum-habana/tree/main/examples/question-answering#fine-tuning-t5-on-squad20)</li> |
| BART | | <div style="text-align:left"><li>Single card</li></div> | <li>[summarization](https://github.com/huggingface/optimum-habana/tree/main/examples/summarization)</li><li>[translation](https://github.com/huggingface/optimum-habana/tree/main/examples/translation)</li><li>[question answering](https://github.com/huggingface/optimum-habana/tree/main/examples/question-answering#fine-tuning-t5-on-squad20)</li> |
| ViT | :heavy_check_mark: | :heavy_check_mark: | <li>[image classification](https://github.com/huggingface/optimum-habana/tree/main/examples/image-classification)</li> |
| Swin | :heavy_check_mark: | :heavy_check_mark: | <li>[image classification](https://github.com/huggingface/optimum-habana/tree/main/examples/image-classification)</li> |
| Wav2Vec2 | :heavy_check_mark: | :heavy_check_mark: | <li>[audio classification](https://github.com/huggingface/optimum-habana/tree/main/examples/audio-classification)</li><li>[speech recognition](https://github.com/huggingface/optimum-habana/tree/main/examples/speech-recognition)</li> |
| CLIP | :heavy_check_mark: | :heavy_check_mark: | <li>[contrastive image-text training](https://github.com/huggingface/optimum-habana/tree/main/examples/contrastive-image-text)</li> |
| BridgeTower | :heavy_check_mark: | :heavy_check_mark: | <li>[contrastive image-text training](https://github.com/huggingface/optimum-habana/tree/main/examples/contrastive-image-text)</li> |
| ESMFold | | <div style="text-align:left"><li>Single card</li></div> | <li>[protein folding](https://github.com/huggingface/optimum-habana/tree/main/examples/protein-folding)</li> |
| Blip | | <div style="text-align:left"><li>Single card</li></div> | <li>[visual question answering](https://github.com/huggingface/optimum-habana/tree/main/examples/visual-question-answering)</li><li>[image to text](https://github.com/huggingface/optimum-habana/tree/main/examples/image-to-text)</li> |

</div>

Expand All @@ -184,7 +199,7 @@ The following model architectures, tasks and device distributions have been vali
<div align="center">

| Architecture | Training | Inference | Tasks |
|------------------|:--------:|:--------------------:|:-----:|
|------------------|:--------:|:--------------------:|:------|
| Stable Diffusion | | <li>Single card</li> | <li>[text-to-image generation](https://github.com/huggingface/optimum-habana/tree/main/examples/stable-diffusion)</li> |
| LDM3D | | <li>Single card</li> | <li>[text-to-image generation](https://github.com/huggingface/optimum-habana/tree/main/examples/stable-diffusion)</li> |

Expand All @@ -195,8 +210,9 @@ The following model architectures, tasks and device distributions have been vali
<div align="center">

| Architecture | Training | Inference | Tasks |
|------------------|:--------:|:--------------------:|:-----:|
| Llama 2 | <li>Multi card</li> | | <li>[DPO Pipeline](https://github.com/huggingface/optimum-habana/tree/main/examples/trl)</li> |
|------------------|:--------:|:--------------------:|:------|
| Llama 2 | :heavy_check_mark: | | <li>[DPO Pipeline](https://github.com/huggingface/optimum-habana/tree/main/examples/trl)</li> |
| Llama 2 | :heavy_check_mark: | | <li>[PPO Pipeline](https://github.com/huggingface/optimum-habana/tree/main/examples/trl)</li> |

</div>

Expand Down
17 changes: 14 additions & 3 deletions docs/source/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,33 @@ In the tables below, ✅ means single-card, multi-card and DeepSpeed have all be
| CodeGen | | <div style="text-align:left"><li>Single card</li></div> | <li>[text generation](https://github.com/huggingface/optimum-habana/tree/main/examples/text-generation)</li> |
| MPT | | <div style="text-align:left"><li>Single card</li></div> | <li>[text generation](https://github.com/huggingface/optimum-habana/tree/main/examples/text-generation)</li> |
| Mistral | | <div style="text-align:left"><li>Single card</li></div> | <li>[text generation](https://github.com/huggingface/optimum-habana/tree/main/examples/text-generation)</li> |
| T5 | ✅ | ✅ | <li>[summarization](https://github.com/huggingface/optimum-habana/tree/main/examples/summarization)</li><li>[translation](https://github.com/huggingface/optimum-habana/tree/main/examples/translation)</li><li>[question answering](https://github.com/huggingface/optimum-habana/tree/main/examples/question-answering#fine-tuning-t5-on-squad20)</li> |
| Mixtral | | <div style="text-align:left"><li>Single card</li></div> | <li>[text generation](https://github.com/huggingface/optimum-habana/tree/main/examples/text-generation)</li> |
| T5 / Flan T5 | ✅ | ✅ | <li>[summarization](https://github.com/huggingface/optimum-habana/tree/main/examples/summarization)</li><li>[translation](https://github.com/huggingface/optimum-habana/tree/main/examples/translation)</li><li>[question answering](https://github.com/huggingface/optimum-habana/tree/main/examples/question-answering#fine-tuning-t5-on-squad20)</li> |
| BART | | <div style="text-align:left"><li>Single card</li></div> | <li>[summarization](https://github.com/huggingface/optimum-habana/tree/main/examples/summarization)</li><li>[translation](https://github.com/huggingface/optimum-habana/tree/main/examples/translation)</li><li>[question answering](https://github.com/huggingface/optimum-habana/tree/main/examples/question-answering#fine-tuning-t5-on-squad20)</li> |
| ViT | ✅ | ✅ | <li>[image classification](https://github.com/huggingface/optimum-habana/tree/main/examples/image-classification)</li> |
| Swin | ✅ | ✅ | <li>[image classification](https://github.com/huggingface/optimum-habana/tree/main/examples/image-classification)</li> |
| Wav2Vec2 | ✅ | ✅ | <li>[audio classification](https://github.com/huggingface/optimum-habana/tree/main/examples/audio-classification)</li><li>[speech recognition](https://github.com/huggingface/optimum-habana/tree/main/examples/speech-recognition)</li> |
| CLIP | ✅ | ✅ | <li>[contrastive image-text training](https://github.com/huggingface/optimum-habana/tree/main/examples/contrastive-image-text)</li> |
| BridgeTower | ✅ | ✅ | <li>[contrastive image-text training](https://github.com/huggingface/optimum-habana/tree/main/examples/contrastive-image-text)</li> |
| ESMFold | | <div style="text-align:left"><li>Single card</li></div> | <li>[protein folding](https://github.com/huggingface/optimum-habana/tree/main/examples/protein-folding)</li> |
| Blip | | <div style="text-align:left"><li>Single card</li></div> | <li>[visual question answering](https://github.com/huggingface/optimum-habana/tree/main/examples/visual-question-answering)</li><li>[image to text](https://github.com/huggingface/optimum-habana/tree/main/examples/image-to-text)</li> |

- Diffusers

| Architecture | Training | Inference | <center>Tasks</center> |
|------------------|:--------:|:---------:|------------------------|
| Architecture | Training | Inference | Tasks |
|------------------|:--------:|:---------:|:------|
| Stable Diffusion | | <div style="text-align:left"><li>Single card</li></div> | <li>[text-to-image generation](https://github.com/huggingface/optimum-habana/tree/main/examples/stable-diffusion)</li> |
| LDM3D | | <div style="text-align:left"><li>Single card</li></div> | <li>[text-to-image generation](https://github.com/huggingface/optimum-habana/tree/main/examples/stable-diffusion)</li> |


- TRL:

| Architecture | Training | Inference | Tasks |
|------------------|:--------:|:--------------------:|:------|
| Llama 2 | ✅ | | <li>[DPO Pipeline](https://github.com/huggingface/optimum-habana/tree/main/examples/trl)</li> |
| Llama 2 | ✅ | | <li>[PPO Pipeline](https://github.com/huggingface/optimum-habana/tree/main/examples/trl)</li> |


Other models and tasks supported by the 🤗 Transformers and 🤗 Diffusers library may also work.
You can refer to this [section](https://github.com/huggingface/optimum-habana#how-to-use-it) for using them with 🤗 Optimum Habana.
Besides, [this page](https://github.com/huggingface/optimum-habana/tree/main/examples) explains how to modify any [example](https://github.com/huggingface/transformers/tree/main/examples/pytorch) from the 🤗 Transformers library to make it work with 🤗 Optimum Habana.
Expand Down
1 change: 1 addition & 0 deletions examples/audio-classification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The following examples showcase how to fine-tune `Wav2Vec2` for audio classifica

Speech recognition models that have been pretrained in an unsupervised fashion on audio data alone, *e.g.* [Wav2Vec2](https://huggingface.co/transformers/main/model_doc/wav2vec2.html), have shown to require only very little annotated data to yield good performance on speech classification datasets.


## Single-HPU

The following command shows how to fine-tune [wav2vec2-base](https://huggingface.co/facebook/wav2vec2-base) on the 🗣️ [Keyword Spotting subset](https://huggingface.co/datasets/superb#ks) of the SUPERB dataset on a single HPU.
Expand Down
6 changes: 3 additions & 3 deletions examples/audio-classification/run_audio_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def check_optimum_habana_min_version(*a, **b):
logger = logging.getLogger(__name__)

# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
check_min_version("4.34.0")
check_optimum_habana_min_version("1.8.1")
check_min_version("4.37.0")
check_optimum_habana_min_version("1.10.0")

require_version("datasets>=1.14.0", "To fix: pip install -r examples/pytorch/audio-classification/requirements.txt")

Expand Down Expand Up @@ -174,7 +174,7 @@ class ModelArguments:
default=False,
metadata={
"help": (
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option "
"should only be set to `True` for repositories you trust and in which you have read the code, as it will "
"execute code present on the Hub on your local machine."
)
Expand Down
5 changes: 4 additions & 1 deletion examples/contrastive-image-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,5 +250,8 @@ python run_clip.py \
--use_lazy_mode \
--use_hpu_graphs_for_inference \
--gaudi_config_name Habana/clip \
--bf16
--bf16 \
--mediapipe_dataloader
```

> `--mediapipe_dataloader` only works on Gaudi2.
10 changes: 5 additions & 5 deletions examples/contrastive-image-text/run_bridgetower.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def check_optimum_habana_min_version(*a, **b):
logger = logging.getLogger(__name__)

# Will error if the minimal version of Transformers and Optimum Habana are not installed. Remove at your own risks.
check_min_version("4.34.0")
check_optimum_habana_min_version("1.8.1")
check_min_version("4.37.0")
check_optimum_habana_min_version("1.10.0")

require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/contrastive-image-text/requirements.txt")

Expand Down Expand Up @@ -109,7 +109,7 @@ class ModelArguments:
default=False,
metadata={
"help": (
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option "
"should only be set to `True` for repositories you trust and in which you have read the code, as it will "
"execute code present on the Hub on your local machine."
)
Expand Down Expand Up @@ -311,7 +311,7 @@ def main():
)
logger.info(f"Training/evaluation parameters {training_args}")

# 3. Detecting last checkpoint and eventualy continue from last checkpoint
# 3. Detecting last checkpoint and eventually continue from last checkpoint
last_checkpoint = None
if os.path.isdir(training_args.output_dir) and training_args.do_train and not training_args.overwrite_output_dir:
last_checkpoint = get_last_checkpoint(training_args.output_dir)
Expand Down Expand Up @@ -578,7 +578,7 @@ def transform_images(examples):
# Transform images on the fly as doing it on the whole dataset takes too much time.
test_dataset.set_transform(transform_images)

# 8. Initalize our trainer
# 8. Initialize our trainer
trainer_cls = HabanaDataloaderTrainer if data_args.mediapipe_dataloader else GaudiTrainer
trainer = trainer_cls(
model=model,
Expand Down
Loading