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

Overview

RustBERTa-SNLI

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

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
Comments
  • Bump anyhow from 1.0.35 to 1.0.43

    Bump anyhow from 1.0.35 to 1.0.43

    Bumps anyhow from 1.0.35 to 1.0.43.

    Release notes

    Sourced from anyhow's releases.

    1.0.43

    • Take -Zallow-features restrictions from Cargo configuration file into account on sufficiently new versions of nightly Cargo (#157, thanks @​jonhoo)

    1.0.42

    • Enable Android's automated tooling to pull in test coverage improvements

    1.0.41

    1.0.40

    • Reduce memory footprint of errors on Rust versions 1.51+ (#145)

    1.0.39

    • Add an opt-in implementation of Error::backtrace on stable compilers based on the backtrace crate (#143)

      [dependencies]
      anyhow = { version = "1.0", features = ["backtrace"] }
      

    1.0.38

    1.0.37

    • Improve compiler diagnostic on calling macro with a temporary value (#133)

    1.0.36

    • Make anyhow::Error ABI compatible with void* for round tripping through a C FFI (#132)
    Commits
    • 39899cc Release 1.0.43
    • f810816 Touch up PR 157
    • a3aba77 Merge pull request #157 from jonhoo/fix-156
    • 6c20a06 Include Cargo rustc configuration in probe
    • 2778943 Merge pull request 160 from BramBonne/version-bump
    • ce33cac Release 1.0.42
    • 496cba4 Bump minor version
    • 88f25d8 Resolve default_trait_access clippy lint in PR 158
    • f01f908 Merge pull request #158 from BramBonne/chain-tests
    • e9e706c Merge pull request 159 from BramBonne/error-coverage
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump flume from 0.10.0 to 0.10.8

    Bump flume from 0.10.0 to 0.10.8

    Bumps flume from 0.10.0 to 0.10.8.

    Changelog

    Sourced from flume's changelog.

    [0.10.8] - 2021-09-06

    Changed

    • Updated nanorand to 0.6

    [0.10.7] - 2021-06-10

    Fixed

    • Removed accidental nightly-only syntax

    [0.10.6] - 2021-06-10

    Added

    • fn into_inner(self) -> T for send errors, allowing for easy access to the unsent message

    [0.10.5] - 2021-04-26

    Added

    • is_disconnected, is_empty, is_full, len, and capacity on future types

    [0.10.4] - 2021-04-12

    Fixed

    • Shutdown-related race condition with async recv that caused spurious errors

    [0.10.3] - 2021-04-09

    Fixed

    • Compilation error when enabling select without eventual_fairness

    [0.10.2] - 2021-02-07

    Fixed

    • Incorrect pointer comparison in Selector causing missing receives

    [0.10.1] - 2020-12-30

    Removed

    • Removed T: Unpin requirement from async traits using pin_project
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump serde_json from 1.0.60 to 1.0.66

    Bump serde_json from 1.0.60 to 1.0.66

    Bumps serde_json from 1.0.60 to 1.0.66.

    Release notes

    Sourced from serde_json's releases.

    v1.0.66

    • Preserve exponent signifier and unary plus in exponent of arbitrary_precision numbers (#786, thanks @​ruifengx)

    v1.0.65

    • Documentation improvements

    v1.0.64

    • Fix deserialization panic on deserializing RawValue from a slice containing non-utf8 bytes (#755)

    v1.0.63

    v1.0.62

    v1.0.61

    Commits
    • 6346bb3 Release 1.0.66
    • 7780a67 Merge pull request #789 from serde-rs/orpattern
    • 53e6ce4 Restore compatiblity with older rustc after PR 786
    • c38fc65 Merge pull request #786 from ruifengx/master
    • c9193d4 Release 1.0.65
    • f205576 Merge pull request 788 from jplatte/doc-cfg
    • 6f15a0e Add doc(cfg(feature = "std")) attribute where appropriate
    • d8f70a3 Add CI job to ensure documentation can be built
    • e2978b6 Document unbounded_depth, raw_value feature-gated API via doc_cfg
    • 2152324 Make arbitrary_precision preserve the exact string representation
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump serde_json from 1.0.60 to 1.0.65

    Bump serde_json from 1.0.60 to 1.0.65

    Bumps serde_json from 1.0.60 to 1.0.65.

    Release notes

    Sourced from serde_json's releases.

    v1.0.65

    • Documentation improvements

    v1.0.64

    • Fix deserialization panic on deserializing RawValue from a slice containing non-utf8 bytes (#755)

    v1.0.63

    v1.0.62

    v1.0.61

    Commits
    • c9193d4 Release 1.0.65
    • f205576 Merge pull request 788 from jplatte/doc-cfg
    • 6f15a0e Add doc(cfg(feature = "std")) attribute where appropriate
    • d8f70a3 Add CI job to ensure documentation can be built
    • e2978b6 Document unbounded_depth, raw_value feature-gated API via doc_cfg
    • ea39063 Update preserve_order required compiler to 1.38.0 for hashbrown
    • df1fb71 Resolve semicolon_if_nothing_returned clippy lints
    • e4057c7 Change readme run buttons to tab style
    • 9e45712 Merge pull request 778 from jayeshmann/patch-1
    • 9cbdfc8 Overlapping button fix
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump anyhow from 1.0.35 to 1.0.42

    Bump anyhow from 1.0.35 to 1.0.42

    Bumps anyhow from 1.0.35 to 1.0.42.

    Release notes

    Sourced from anyhow's releases.

    1.0.42

    • Enable Android's automated tooling to pull in test coverage improvements

    1.0.41

    1.0.40

    • Reduce memory footprint of errors on Rust versions 1.51+ (#145)

    1.0.39

    • Add an opt-in implementation of Error::backtrace on stable compilers based on the backtrace crate (#143)

      [dependencies]
      anyhow = { version = "1.0", features = ["backtrace"] }
      

    1.0.38

    1.0.37

    • Improve compiler diagnostic on calling macro with a temporary value (#133)

    1.0.36

    • Make anyhow::Error ABI compatible with void* for round tripping through a C FFI (#132)
    Commits
    • ce33cac Release 1.0.42
    • 88f25d8 Resolve default_trait_access clippy lint in PR 158
    • f01f908 Merge pull request #158 from BramBonne/chain-tests
    • e9e706c Merge pull request 159 from BramBonne/error-coverage
    • 6632b23 Ignore buggy nonstandard_macro_braces clippy lint
    • 02f10bf Increase error test coverage.
    • 6050c73 Increase Chain test coverage.
    • b4f670d Release 1.0.41
    • 8bf68c8 Merge pull request 155 from jfirebaugh/patch-1
    • 254c3b6 Depend on a recent-enough version of backtrace
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump flume from 0.10.0 to 0.10.7

    Bump flume from 0.10.0 to 0.10.7

    Bumps flume from 0.10.0 to 0.10.7.

    Changelog

    Sourced from flume's changelog.

    Changelog

    All notable changes to this project will be documented in this file.

    The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

    Unreleased

    Added

    Removed

    Changed

    Fixed

    [0.10.6] - 2021-06-10

    Fixed

    • Removed accidental nightly-only syntax

    [0.10.6] - 2021-06-10

    Added

    • fn into_inner(self) -> T for send errors, allowing for easy access to the unsent message

    [0.10.5] - 2021-04-26

    Added

    • is_disconnected, is_empty, is_full, len, and capacity on future types

    [0.10.4] - 2021-04-12

    Fixed

    • Shutdown-related race condition with async recv that caused spurious errors

    [0.10.3] - 2021-04-09

    Fixed

    • Compilation error when enabling select without eventual_fairness

    [0.10.2] - 2021-02-07

    Fixed

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump anyhow from 1.0.35 to 1.0.41

    Bump anyhow from 1.0.35 to 1.0.41

    Bumps anyhow from 1.0.35 to 1.0.41.

    Release notes

    Sourced from anyhow's releases.

    1.0.41

    1.0.40

    • Reduce memory footprint of errors on Rust versions 1.51+ (#145)

    1.0.39

    • Add an opt-in implementation of Error::backtrace on stable compilers based on the backtrace crate (#143)

      [dependencies]
      anyhow = { version = "1.0", features = ["backtrace"] }
      

    1.0.38

    1.0.37

    • Improve compiler diagnostic on calling macro with a temporary value (#133)

    1.0.36

    • Make anyhow::Error ABI compatible with void* for round tripping through a C FFI (#132)
    Commits
    • b4f670d Release 1.0.41
    • 8bf68c8 Merge pull request 155 from jfirebaugh/patch-1
    • 254c3b6 Depend on a recent-enough version of backtrace
    • 29e4e0e Update ui test suite to nightly-2021-05-14
    • aa6c83d Resolve branches_sharing_code clippy lint
    • 704622f Release 1.0.40
    • 64ac0c0 Merge pull request #145 from dtolnay/addrof
    • ef08267 Eliminate functionally duplicate vtable methods on rustc 1.51+
    • 1295b1f Add additional builds on 1.50 and 1.51 validating addr_of codepath
    • be89adf Detect whether ptr::addr_of is supported by current compiler
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump flume from 0.10.0 to 0.10.5

    Bump flume from 0.10.0 to 0.10.5

    Bumps flume from 0.10.0 to 0.10.5.

    Changelog

    Sourced from flume's changelog.

    [0.10.5] - 2021-04-26

    Added

    • is_disconnected, is_empty, is_full, len, and capacity on future types

    [0.10.4] - 2021-04-12

    Fixed

    • Shutdown-related race condition with async recv that caused spurious errors

    [0.10.3] - 2021-04-09

    Fixed

    • Compilation error when enabling select without eventual_fairness

    [0.10.2] - 2021-02-07

    Fixed

    • Incorrect pointer comparison in Selector causing missing receives

    [0.10.1] - 2020-12-30

    Removed

    • Removed T: Unpin requirement from async traits using pin_project
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump flume from 0.10.0 to 0.10.4

    Bump flume from 0.10.0 to 0.10.4

    Bumps flume from 0.10.0 to 0.10.4.

    Changelog

    Sourced from flume's changelog.

    [0.10.4] - 2021-04-12

    Fixed

    • Shutdown-related race condition with async recv that caused spurious errors

    [0.10.3] - 2021-04-09

    Fixed

    • Compilation error when enabling select without eventual_fairness

    [0.10.2] - 2021-02-07

    Fixed

    • Incorrect pointer comparison in Selector causing missing receives

    [0.10.1] - 2020-12-30

    Removed

    • Removed T: Unpin requirement from async traits using pin_project
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump flume from 0.10.0 to 0.10.3

    Bump flume from 0.10.0 to 0.10.3

    Bumps flume from 0.10.0 to 0.10.3.

    Changelog

    Sourced from flume's changelog.

    [0.10.3] - 2021-04-09

    Fixed

    • Compilation error when enabling select without eventual_fairness

    [0.10.2] - 2021-02-07

    Fixed

    • Incorrect pointer comparison in Selector causing missing receives

    [0.10.1] - 2020-12-30

    Removed

    • Removed T: Unpin requirement from async traits using pin_project
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump anyhow from 1.0.35 to 1.0.40

    Bump anyhow from 1.0.35 to 1.0.40

    Bumps anyhow from 1.0.35 to 1.0.40.

    Release notes

    Sourced from anyhow's releases.

    1.0.40

    • Reduce memory footprint of errors on Rust versions 1.51+ (#145)

    1.0.39

    • Add an opt-in implementation of Error::backtrace on stable compilers based on the backtrace crate (#143)

      [dependencies]
      anyhow = { version = "1.0", features = ["backtrace"] }
      

    1.0.38

    1.0.37

    • Improve compiler diagnostic on calling macro with a temporary value (#133)

    1.0.36

    • Make anyhow::Error ABI compatible with void* for round tripping through a C FFI (#132)
    Commits
    • 704622f Release 1.0.40
    • 64ac0c0 Merge pull request #145 from dtolnay/addrof
    • ef08267 Eliminate functionally duplicate vtable methods on rustc 1.51+
    • 1295b1f Add additional builds on 1.50 and 1.51 validating addr_of codepath
    • be89adf Detect whether ptr::addr_of is supported by current compiler
    • ac64560 Switch object_ref return from real ref to Ref ptr
    • 2987c9b Ignore redundant_else pedantic clippy lint
    • 827bb9d Catch some warnings in addr_of-related codepaths
    • ce00418 Merge pull request #144 from dtolnay/ptr
    • 3c32aa7 Relax Sized bound on Own, Ref, Mut ptrs
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump anyhow from 1.0.35 to 1.0.44

    Bump anyhow from 1.0.35 to 1.0.44

    Bumps anyhow from 1.0.35 to 1.0.44.

    Release notes

    Sourced from anyhow's releases.

    1.0.44

    • Mark error constructors cold to help LLVM optimize code paths not leading to error (#166, thanks @​stepancheg)

    1.0.43

    • Take -Zallow-features restrictions from Cargo configuration file into account on sufficiently new versions of nightly Cargo (#157, thanks @​jonhoo)

    1.0.42

    • Enable Android's automated tooling to pull in test coverage improvements

    1.0.41

    1.0.40

    • Reduce memory footprint of errors on Rust versions 1.51+ (#145)

    1.0.39

    • Add an opt-in implementation of Error::backtrace on stable compilers based on the backtrace crate (#143)

      [dependencies]
      anyhow = { version = "1.0", features = ["backtrace"] }
      

    1.0.38

    1.0.37

    • Improve compiler diagnostic on calling macro with a temporary value (#133)

    1.0.36

    • Make anyhow::Error ABI compatible with void* for round tripping through a C FFI (#132)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump serde_json from 1.0.60 to 1.0.67

    Bump serde_json from 1.0.60 to 1.0.67

    Bumps serde_json from 1.0.60 to 1.0.67.

    Release notes

    Sourced from serde_json's releases.

    v1.0.67

    • Fix inconsistency of deserialization of unknown fields in a struct variant from bytes vs from Value (#795)

    v1.0.66

    • Preserve exponent signifier and unary plus in exponent of arbitrary_precision numbers (#786, thanks @​ruifengx)

    v1.0.65

    • Documentation improvements

    v1.0.64

    • Fix deserialization panic on deserializing RawValue from a slice containing non-utf8 bytes (#755)

    v1.0.63

    v1.0.62

    v1.0.61

    Commits
    • f6bbab4 Release 1.0.67
    • 55efb3f Merge pull request #796 from dtolnay/visitobject
    • c7b7186 Detect unknown struct variant fields deserializing from Value
    • 12207ed Add regression test for issue 795
    • 7b4585f Merge pull request #794 from dtolnay/visitarray
    • 89cfb45 Use existing helpers for running visit_seq over a Vec/slice
    • 604d5cf Merge pull request #793 from dtolnay/valuede
    • cdc2ad3 Delete Deserializer impl from value::de::MapRefDeserializer
    • cb1e730 Delete Deserializer impl from value::de::SeqRefDeserializer
    • fcd94f0 Delete Deserializer impl from value::de::SeqDeserializer
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump flume from 0.10.0 to 0.10.9

    Bump flume from 0.10.0 to 0.10.9

    Bumps flume from 0.10.0 to 0.10.9.

    Changelog

    Sourced from flume's changelog.

    [0.10.9] - 2021-08-25

    Changed

    • Switched from spinning_top to spin

    [0.10.8] - 2021-08-06

    Changed

    • Updated nanorand to 0.6

    [0.10.7] - 2021-06-10

    Fixed

    • Removed accidental nightly-only syntax

    [0.10.6] - 2021-06-10

    Added

    • fn into_inner(self) -> T for send errors, allowing for easy access to the unsent message

    [0.10.5] - 2021-04-26

    Added

    • is_disconnected, is_empty, is_full, len, and capacity on future types

    [0.10.4] - 2021-04-12

    Fixed

    • Shutdown-related race condition with async recv that caused spurious errors

    [0.10.3] - 2021-04-09

    Fixed

    • Compilation error when enabling select without eventual_fairness

    [0.10.2] - 2021-02-07

    Fixed

    • Incorrect pointer comparison in Selector causing missing receives

    [0.10.1] - 2020-12-30

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump rand from 0.7.3 to 0.8.4

    Bump rand from 0.7.3 to 0.8.4

    Bumps rand from 0.7.3 to 0.8.4.

    Changelog

    Sourced from rand's changelog.

    [0.8.4] - 2021-06-15

    Additions

    • Use const-generics to support arrays of all sizes (#1104)
    • Implement Clone and Copy for Alphanumeric (#1126)
    • Add Distribution::map to derive a distribution using a closure (#1129)
    • Add Slice distribution (#1107)
    • Add DistString trait with impls for Standard and Alphanumeric (#1133)

    Other

    • Reorder asserts in Uniform float distributions for easier debugging of non-finite arguments (#1094, #1108)
    • Add range overflow check in Uniform float distributions (#1108)
    • Deprecate rngs::adapter::ReadRng (#1130)

    [0.8.3] - 2021-01-25

    Fixes

    • Fix no-std + alloc build by gating choose_multiple_weighted on std (#1088)

    [0.8.2] - 2021-01-12

    Fixes

    • Fix panic in UniformInt::sample_single_inclusive and Rng::gen_range when providing a full integer range (eg 0..=MAX) (#1087)

    [0.8.1] - 2020-12-31

    Other

    • Enable all stable features in the playground (#1081)

    [0.8.0] - 2020-12-18

    Platform support

    • The minimum supported Rust version is now 1.36 (#1011)
    • getrandom updated to v0.2 (#1041)
    • Remove wasm-bindgen and stdweb feature flags. For details of WASM support, see the getrandom documentation. (#948)
    • ReadRng::next_u32 and next_u64 now use little-Endian conversion instead of native-Endian, affecting results on Big-Endian platforms (#1061)
    • The nightly feature no longer implies the simd_support feature (#1048)
    • Fix simd_support feature to work on current nightlies (#1056)

    Rngs

    • ThreadRng is no longer Copy to enable safe usage within thread-local destructors (#1035)
    • gen_range(a, b) was replaced with gen_range(a..b). gen_range(a..=b) is also supported. Note that a and b can no longer be references or SIMD types. (#744, #1003)
    • Replace AsByteSliceMut with Fill and add support for [bool], [char], [f32], [f64] (#940)
    • Restrict rand::rngs::adapter to std (#1027; see also #928)
    • StdRng: add new std_rng feature flag (enabled by default, but might need to be used if disabling default crate features) (#948)
    • StdRng: Switch from ChaCha20 to ChaCha12 for better performance (#1028)
    • SmallRng: Replace PCG algorithm with xoshiro{128,256}++ (#1038)

    Sequences

    ... (truncated)

    Commits
    • 8792268 Merge pull request #1137 from rust-random/work2
    • 1bfc53d Update changelogs and bump version numbers
    • 4534311 Merge pull request #1133 from rust-random/work2
    • 81f1af8 Correct usage of reserve
    • fa17d1c Add comment to append_string for Standard
    • b4c1d66 Add DistString
    • 1947c89 Move Distribution trait and associates to sub-module
    • 98a0339 Merge pull request #1135 from dhardy/work
    • a7f8fb7 Prepare rand_chacha v0.3.1 release
    • 09d3df3 Merge pull request #1130 from dhardy/work
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump tokio from 0.2.22 to 0.3.5

    Bump tokio from 0.2.22 to 0.3.5

    Bumps tokio from 0.2.22 to 0.3.5.

    Release notes

    Sourced from tokio's releases.

    Tokio v0.3.5

    Fixed

    • rt: fix shutdown_timeout(0) (#3196).
    • time: fixed race condition with small sleeps (#3069).

    Added

    • io: AsyncFd::with_interest() (#3167).
    • signal: CtrlC stream on windows (#3186).

    Tokio v0.3.4

    Fixed

    • stream: StreamMap Default impl bound (#3093).
    • io: AsyncFd::into_inner() should deregister the FD (#3104).

    Changed

    • meta: parking_lot feature enabled with full (#3119).

    Added

    • io: AsyncWrite vectored writes (#3149).
    • net: TCP/UDP readiness and non-blocking ops (#3130, #2743, #3138).
    • net: TCP socket option (linger, send/recv buf size) (#3145, #3143).
    • net: PID field in UCred with solaris/illumos (#3085).
    • rt: runtime::Handle allows spawning onto a runtime (#3079).
    • sync: Notify::notify_waiters() (#3098).
    • sync: acquire_many(), try_acquire_many() to Semaphore (#3067).

    Tokio v0.3.3

    Fixes a soundness hole by adding a missing Send bound to Runtime::spawn_blocking().

    Fixed

    • rt: include missing Send, fixing soundness hole (#3089).
    • tracing: avoid huge trace span names (#3074).

    Added

    • net: TcpSocket::reuseport(), TcpSocket::set_reuseport() (#3083).
    • net: TcpSocket::reuseaddr() (#3093).
    • net: TcpSocket::local_addr() (#3093).
    • net: add pid to UCred (#2633).

    Tokio v0.3.2

    Adds AsyncFd as a replacement for v0.2's PollEvented.

    Fixed

    • io: fix a potential deadlock when shutting down the I/O driver (#2903).
    • sync: RwLockWriteGuard::downgrade() bug (#2957).

    Added

    • io: AsyncFd for receiving readiness events on raw FDs (#2903).
    • net: poll_* function on UdpSocket (#2981).
    • net: UdpSocket::take_error() (#3051).

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
Owner
AI2
AI2
Multilingual implementation of RAKE algorithm for Rust

RAKE.rs The library provides a multilingual implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm for Rust. How to Use Append rake to

Navid 26 Dec 16, 2022
Snips NLU rust implementation

Snips NLU Rust Installation Add it to your Cargo.toml: [dependencies] snips-nlu-lib = { git = "https://github.com/snipsco/snips-nlu-rs", branch = "mas

Snips 327 Dec 26, 2022
A fast implementation of Aho-Corasick in Rust.

aho-corasick A library for finding occurrences of many patterns at once with SIMD acceleration in some cases. This library provides multiple pattern s

Andrew Gallant 662 Dec 31, 2022
A rust implementation of some popular snowball stemming algorithms

Rust Stemmers This crate implements some stemmer algorithms found in the snowball project which are compiled to rust using the rust-backend of the sno

CurrySoftware GmbH 84 Dec 15, 2022
Gomez - A pure Rust framework and implementation of (derivative-free) methods for solving nonlinear (bound-constrained) systems of equations

Gomez A pure Rust framework and implementation of (derivative-free) methods for solving nonlinear (bound-constrained) systems of equations. Warning: T

Datamole 19 Dec 24, 2022
Implementation of sentence embeddings with BERT in Rust, using the Burn library.

Sentence Transformers in Burn This library provides an implementation of the Sentence Transformers framework for computing text representations as vec

Tyler Vergho 4 Sep 4, 2023
A naive native 128-bit cityhash v102 implementation

Naive CityHash naive-cityhash is a naive native 128-bit cityhash v102 implementation for clickhouse*. Contact Chojan Shang - @PsiACE - psiace@outlook.

Chojan Shang 5 Apr 4, 2022
A naive (read: slow) implementation of Word2Vec. Uses BLAS behind the scenes for speed.

SloWord2Vec This is a naive implementation of Word2Vec implemented in Rust. The goal is to learn the basic principles and formulas behind Word2Vec. BT

Lloyd 2 Jul 5, 2018
A "Navie" Implementation of the Wavefront Algorithm For Sequence Alignment with Gap-Affine Scoring

A "Naive" Implementation of the Wavefront Algorithm for Sequence Alignment with Gap-Affine Scoring This repository contains some simple code that I wr

Jason Chin 3 Jul 24, 2023
Simple, robust, BitTorrent's Mainline DHT implementation

Mainline Simple, robust, BitTorrent's Mainline DHT implementation. This library is focused on being the best and simplest Rust client for Mainline, es

Nuh 4 Nov 21, 2023
Rust-nlp is a library to use Natural Language Processing algorithm with RUST

nlp Rust-nlp Implemented algorithm Distance Levenshtein (Explanation) Jaro / Jaro-Winkler (Explanation) Phonetics Soundex (Explanation) Metaphone (Exp

Simon Paitrault 34 Dec 20, 2022
Fast suffix arrays for Rust (with Unicode support).

suffix Fast linear time & space suffix arrays for Rust. Supports Unicode! Dual-licensed under MIT or the UNLICENSE. Documentation https://docs.rs/suff

Andrew Gallant 207 Dec 26, 2022
Elastic tabstops for Rust.

tabwriter is a crate that implements elastic tabstops. It provides both a library for wrapping Rust Writers and a small program that exposes the same

Andrew Gallant 212 Dec 16, 2022
An efficient and powerful Rust library for word wrapping text.

Textwrap Textwrap is a library for wrapping and indenting text. It is most often used by command-line programs to format dynamic output nicely so it l

Martin Geisler 322 Dec 26, 2022
⏮ ⏯ ⏭ A Rust library to easily read forwards, backwards or randomly through the lines of huge files.

EasyReader The main goal of this library is to allow long navigations through the lines of large files, freely moving forwards and backwards or gettin

Michele Federici 81 Dec 6, 2022
Natural language detection library for Rust. Try demo online: https://www.greyblake.com/whatlang/

Whatlang Natural language detection for Rust with focus on simplicity and performance. Content Features Get started Documentation Supported languages

Sergey Potapov 805 Dec 28, 2022
A Rust library for generically joining iterables with a separator

joinery A Rust library for generically joining iterables with a separator. Provides the tragically missing string join functionality to rust. extern c

Nathan West 72 Dec 16, 2022
Rust edit distance routines accelerated using SIMD. Supports fast Hamming, Levenshtein, restricted Damerau-Levenshtein, etc. distance calculations and string search.

triple_accel Rust edit distance routines accelerated using SIMD. Supports fast Hamming, Levenshtein, restricted Damerau-Levenshtein, etc. distance cal

Daniel Liu 75 Jan 8, 2023
Rust native ready-to-use NLP pipelines and transformer-based models (BERT, DistilBERT, GPT2,...)

rust-bert Rust native Transformer-based models implementation. Port of Hugging Face's Transformers library, using the tch-rs crate and pre-processing

null 1.3k Jan 8, 2023