Skip to main content

Transformer-based models implemented in tensorflow 2.x(Keras)

Project description

transformers-keras

Python package PyPI version Python

Transformer-based models implemented in tensorflow 2.x(Keras).

Installation

pip install -U transformers-keras

Models

BERT

All the bert models pretrained by google-research/bert can be loaded:

from transformers_keras import Bert

model = Bert.from_pretrained('/path/to/pretrained/bert/model')
# then, use this model to fine-tune new model as a keras layer, or to do inference
model(model.dummy_inputs())

ALBERT

All the albert models pretrained by google-research/albert can be loaded:

from transformers_keras import Albert

model = Bert.from_pretrained('/path/to/pretrained/albert/model')
# then, use this model to fine-tune new model as a keras layer, or to do inference
model(model.dummy_inputs())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transformers_keras-0.2.0.tar.gz (16.1 kB view hashes)

Uploaded Source

Built Distribution

transformers_keras-0.2.0-py3-none-any.whl (27.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page