Skip to content

Commit

Permalink
Add MT5 model and fine-tuning notebook (#392)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: James Briggs <jamesbr@graphcore.ai>
Co-authored-by: jayniep-gc <92803120+jayniep-gc@users.noreply.github.com>
  • Loading branch information
3 people authored May 23, 2023
1 parent db64833 commit ee3e622
Show file tree
Hide file tree
Showing 8 changed files with 1,729 additions and 1 deletion.
Binary file added notebooks/images/mt5_oom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
718 changes: 718 additions & 0 deletions notebooks/mt5_translation.ipynb

Large diffs are not rendered by default.

419 changes: 419 additions & 0 deletions notebooks/mt5_xnli.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions optimum/graphcore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
)
from .models.hubert import PipelinedHubertForSequenceClassification
from .models.lxmert import PipelinedLxmertForQuestionAnswering
from .models.mt5 import PipelinedMT5ForConditionalGeneration
from .models.roberta import (
PipelinedRobertaForMaskedLM,
PipelinedRobertaForMultipleChoice,
Expand Down
2 changes: 1 addition & 1 deletion optimum/graphcore/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from . import bart, bert, convnext, deberta, gpt2, groupbert, hubert, lxmert, roberta, t5, vit, wav2vec2, whisper
from . import bart, bert, convnext, deberta, gpt2, groupbert, hubert, lxmert, mt5, roberta, t5, vit, wav2vec2, whisper
19 changes: 19 additions & 0 deletions optimum/graphcore/models/mt5/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.

# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .modeling_mt5 import PipelinedMT5ForConditionalGeneration
570 changes: 570 additions & 0 deletions optimum/graphcore/models/mt5/modeling_mt5.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"lxmert": ("unc-nlp/lxmert-base-uncased", "Graphcore/lxmert-base-ipu"),
"roberta": ("roberta-base", "Graphcore/roberta-base-ipu"),
"t5": ("t5-small", "Graphcore/t5-small-ipu"),
"mt5": ("google/mt5-small", "Graphcore/mt5-small-ipu"),
"vit": ("google/vit-base-patch16-224-in21k", "Graphcore/vit-base-ipu"),
"wav2vec2": {
"default": ("facebook/wav2vec2-base", "Graphcore/wav2vec2-base-ipu"),
Expand Down

0 comments on commit ee3e622

Please sign in to comment.