This TPU VM cheatsheet uses and was tested with the following library versions:
| Library | Version |
|---|---|
| JAX | 0.3.25 |
| FLAX | 0.6.4 |
| Datasets | 2.10.1 |
| Transformers | 4.27.1 |
This TPU VM cheatsheet uses and was tested with the following library versions:
| Library | Version |
|---|---|
| JAX | 0.3.25 |
| FLAX | 0.6.4 |
| Datasets | 2.10.1 |
| Transformers | 4.27.1 |
| # coding=utf-8 | |
| # Copyright 2018 The HuggingFace Inc. team. | |
| # | |
| # 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 |
| import click | |
| import numpy as np | |
| import torch | |
| from collections import namedtuple | |
| from pytorch_transformers import BertForTokenClassification, BertTokenizer | |
| from torch.nn import CrossEntropyLoss | |
| from torch.utils.data import DataLoader, SequentialSampler, TensorDataset |
| from __future__ import absolute_import, division, print_function | |
| import argparse | |
| import glob | |
| import logging | |
| import os | |
| import random | |
| import numpy as np | |
| import torch |