rustberta-snli

App Archived

🦀 A Rust implementation of a RoBERTa classification model for the SNLI dataset

Checked · Sources

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

From the project README ·

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.

rustup can be used to update your toolchain when a new version of Rust is released (which happens monthly). cargo is 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
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.

rustberta-snli beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
rustberta-snli This page App Archived

🦀 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
AdoptionNot measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependentsNot measuredYes
New dependents (365 days)Not measuredYes
Peak active dependentsNot measuredYes
Active dependents as a share of the peakNot measuredYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 5 years ago8 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2020-12-11GitHub repositoryYes
Latest releaseNot measuredYes
First releaseNot measuredYes
Latest versionNot measuredYes
Days the oldest outside issue waits for a reply0GitHub repositoryYes
Maintainer replies over 365 days0GitHub repositoryYes
Repository archivedtrueGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repoNot measuredYes
Published docsNot measuredYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityNot measured
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windowNot measuredYes
RustSec unmaintained advisoryNot measuredYes
Deprecation noticeNot measuredYes
Deprecated requirementNot measuredYes
Distribution0 binary downloads over the last 3 releases10 not measured
Distribution measurements
SignalValueSourceFetchedCounts
ReleasesNot measuredYes
Downloads over 30 daysNot measuredYes
Binary downloads over the last 3 releases0GitHub releasesYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleaseNot measuredYes
Every version 0.0.xNot measuredYes
Every version yankedNot measuredYes
Crate deleted from crates.ioNot measuredYes
Repository13 stars, 1 forks, 2 contributors, 46 commits. Stars alone never qualify a project.1 not measured
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars13GitHub repositoryYes — one part of the repository route
GitHub forks1GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account2GitHub contributorsYes — one part of the repository route
Commits on the default branch46GitHub repositoryNo
Repository's main crate left out of the entryNot measuredYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseNone statedGitHub repositoryNo
Runs on, from listed crates and their direct dependenciesNot measuredNo
What shows each backendNot measuredNo
Native code, from listed crates and their dependenciesNot measuredNo
Python bindings, from direct dependencies of listed cratesNot measuredNo
Crates that depend on a listed crate directlyNot measuredNo

Corrections and review history

Report a correction

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.