Created
September 4, 2023 15:04
-
-
Save pythonlessons/46d80473990e390782b73248d195ebb5 to your computer and use it in GitHub Desktop.
transformers_training
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
try: [tf.config.experimental.set_memory_growth(gpu, True) for gpu in tf.config.experimental.list_physical_devices("GPU")] | |
except: pass | |
from keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau, TensorBoard | |
from mltu.tensorflow.callbacks import Model2onnx, WarmupCosineDecay | |
from mltu.tensorflow.dataProvider import DataProvider | |
from mltu.tokenizers import CustomTokenizer | |
from mltu.tensorflow.transformer.utils import MaskedAccuracy, MaskedLoss | |
from mltu.tensorflow.transformer.callbacks import EncDecSplitCallback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment