rustberta-snli
App Archived
🦀 A Rust implementation of a RoBERTa classification model for the SNLI dataset
- Downloads
- Not measured
- Dependents
- Not applicable
- Stars
- 13
- Forks
- 1
- Contributors
- 2
- Commits
- 46
Why Archived
GitHub reports the repository as archived.
Exact rules: Instant archive. The check on applied thresholds version 9.
Every rule outcome, as the check records it
instant-archive: repository is archived
About
A Rust implementation of a RoBERTa classification model for the SNLI dataset, with support for fine-tuning, predicting, and serving. This is built on top of tch-rs and rust-bert.

Background
This was the result of the AI2 2020 Employee Hackathon. The motivation for this project was to demonstrate that Rust is already a viable alternative to Python for deep learning projects in the context of both research and production.
Setup
RustBERTa-SNLI is packaged as a Rust binary, and will work on any operating system that PyTorch supports.
The only prerequisite is that you have the Rust toolchain installed. So if you're already a Rustacean, skip ahead to the "Additional setup for CUDA" section (optional).
Now, luckily, installing Rust is nothing like installing a proper Python environment, i.e. it doesn't require a PhD in system administration or the courage to blindly run every sudo command you can find on Stack Overflow until something works or completely breaks your computer.
All you have to do is run this:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Read the full README
Then just make sure ~/.cargo/bin is in your $PATH, and you're good to go.
You can test for success by running rustup --version and cargo --version.
rustupcan be used to update your toolchain when a new version of Rust is released (which happens monthly).cargois used to compile, run, and test your code, as well as to build documentation, publish your crate (the Rust term for a module/library) to crates.io, and install binaries from other crates on crates.io.
Additional setup for CUDA
If you have CUDA-enabled GPUs available on your machine, you'll probably want to compile this library with CUDA support.
To do that, you just need to download the right version of LibTorch from the PyTorch website: https://pytorch.org/get-started/locally/.
Then unzip the downloaded file to someplace safe like ~/torch/libtorch and set the environment variables:
LIBTORCH="$HOME/torch/libtorch" # or wherever you unzipped it
LD_LIBRARY_PATH="$HOME/torch/libtorch/lib:$LD_LIBRARY_PATH"
‼️ NOTE: it's important that you do this step before trying to compile the Rust binary with cargo. But if you accidentally start the build
for this step, just delete the target/ directory and start over.
Compiling and running
To build the release binary, just run make.
To see all of the available commands, run
./roberta-snli --help
For example, to fine-tune a pretrained RoBERTa model, run
./roberta-snli train --out weights.ot
To interactively get predictions with a fine-tuned model, run
./roberta-snli predict --weigths weights.ot
To evaluate a fine-tuned model on the test set, run
./roberta-snli evaluate
And to serve a fine-tuned model as a production-grade webservice with batched prediction, run
./roberta-snli serve
This will serve on port 3030 by default. You can then test it out by running:
curl \
-d '{"premise":"A soccer game with multiple people playing.","hypothesis":"Some people are playing a sport."}' \
-H "Content-Type: application/json" \
http://localhost:3030/predict
You can also test the batching functionality by sending a bunch of requests at once with:
./scripts/test_server.sh
Compatibility
- License
- None stated
- Crate facts
- Not measured
- Runs on, Native code and Python bindings read crates on crates.io. This entry lists no crate.
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
🦀 A Rust implementation of a RoBERTa classification model for the SNLI dataset |
Not measured | Not applicable | 13 | Not measured | Not measured | Not measured | None stated |
|
tokenizers Featured
Fastest implementation of the most used tokenizers in AI. |
7,490,451 downloads over 30 days | 1,021 | 11,230 | 0.23.2 | GPU support unknown | Binds native code: tikv-jemalloc-sys, onig_sys (feature default) | Apache-2.0 |
|
tiktoken-rs Featured
Library for encoding and decoding with the tiktoken library in Rust |
3,939,182 downloads over 30 days | 449 | 410 | 0.12.1 | GPU support unknown | No native code found | MIT |
|
snowball Listed
Rust implementation of Snowball stemming algorithms for 33 languages |
21,654 downloads over 30 days | 3 | 891 | 0.1.0 | GPU support unknown | No native code found | BSD-3-Clause |
|
splintr Listed
Tokenizer for Rust and Python: pure Rust by default, with 18 bundled vocabularies and four backends covering BPE, SentencePiece and WordPiece. Its output matches Hugging Face tokenizers id for id on 14 model families, including GPT-2, Qwen, Whisper, T5 and BERT. Python bindings |
8,204 downloads over 30 days | 7 | 63 | 0.22.2 | GPU support unknown | Binds native code: pcre2-sys (feature pcre2) | MIT |
|
From-scratch pure-Rust SentencePiece inference (encode/decode), differentially verified against the upstream C++/Python implementation. |
8,442 downloads over 30 days | 3 | 1 | 0.1.1 | GPU support unknown | No native code found | Apache-2.0 |
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources4 sources
- Description: the GitHub repository description
- GitHub repository, fetched
- GitHub releases, fetched
- GitHub contributors, fetched
AdoptionNot measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | Not measured | Yes | ||
| New dependents (365 days) | Not measured | Yes | ||
| Peak active dependents | Not measured | Yes | ||
| Active dependents as a share of the peak | Not measured | Yes | ||
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 5 years ago8 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2020-12-11 | GitHub repository | Yes | |
| Latest release | Not measured | Yes | ||
| First release | Not measured | Yes | ||
| Latest version | Not measured | Yes | ||
| Days the oldest outside issue waits for a reply | 0 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | true | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | Not measured | Yes | ||
| Published docs | Not measured | Yes | ||
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityNot measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | Not measured | Yes | ||
| RustSec unmaintained advisory | Not measured | Yes | ||
| Deprecation notice | Not measured | Yes | ||
| Deprecated requirement | Not measured | Yes |
Distribution0 binary downloads over the last 3 releases10 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | Not measured | Yes | ||
| Downloads over 30 days | Not measured | Yes | ||
| Binary downloads over the last 3 releases | 0 | GitHub releases | Yes | |
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | Not measured | Yes | ||
| Every version 0.0.x | Not measured | Yes | ||
| Every version yanked | Not measured | Yes | ||
| Crate deleted from crates.io | Not measured | Yes |
Repository13 stars, 1 forks, 2 contributors, 46 commits. Stars alone never qualify a project.1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 13 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 1 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 2 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 46 | GitHub repository | No | |
| Repository's main crate left out of the entry | Not measured | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | None stated | GitHub repository | No | |
| Runs on, from listed crates and their direct dependencies | Not measured | No | ||
| What shows each backend | Not measured | No | ||
| Native code, from listed crates and their dependencies | Not measured | No | ||
| Python bindings, from direct dependencies of listed crates | Not measured | No | ||
| Crates that depend on a listed crate directly | Not measured | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.