Crates.io | gpt-model |
lib.rs | gpt-model |
version | 0.1.0 |
source | src |
created_at | 2024-02-24 01:23:06.146746 |
updated_at | 2024-02-24 01:23:06.146746 |
description | Pure-Rust inference wrapper for GPT-2 large language models. |
homepage | |
repository | https://gitlab.com/caer/gpt |
max_upload_size | |
id | 1151167 |
size | 76,498 |
100% pure Rust inference wrapper for the GPT-2 (and possibly later) model family.
The GPT-2 model packaged within the crate's repository uses the original model trained by OpenAI, with minor modifications to support Tensorflow 2.0, and to support conversion to the ONNX model format.
When getting started with this crate, we recommend using our prebuilt
version of the 124M
(smallest) GPT-2 model; the model, encoder, and
byte-pair encoding vocabulary for this model may all be downloaded from
here.
src/
: Main crate contents, including a pure Rust implementation
of the GPT-2 byte-pair encoder (tokenizer) and a Rust wrapper for loading
and invoking an ONNX GPT-2 model.gpt-2-model/
: Python scripts and Docker files to
download and export Tensorflow and ONNX versions of the GPT-2 model.gpt-2-model/saved_models
: Exported
GPT-2 models. The latest prebuilt version of the 124M
(smallest)
GPT-2 model is shipped with this repo, as part of Git LFS.Except where otherwise noted, this project is Copyright (C) 2022-24 Brandon Sanders [me@caer.cc], and licensed under the AGPL-3.0-only.
The files within the gpt-2-model
directory
are Copyright (C) 2019 OpenAI and (C) 2022-24 Brandon
Sanders, and licensed under an MIT-style license.
Contributions are always welcome!