Skip to content

Ardnys/samurai-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Samurai

Logo

Overview

A samurai is a server that summarizes given text. This is the first samurai implementation that uses locally deployed NLP model. Originally a part of CFS but it can be used for any summarization task.
However, I could not make it asynchronous because the NLP model is not thread safe and I don't know how to work around that. Contributions or discussions regarding this is greatly appreaciated. Please open an issue and we can discuss it.

What makes a Samurai?

Making a custom samurai is simple. But it must conform to following attributes to work with CFS:

  • It must listen to port 7878 for requests.
  • It must listen /summarize endpoint for POST requests that accept plain text and return the summarized text as plain text.
  • It's strongly recommended to have a /shutdown GET endpoint to for graceful shutdown.
  • It's preferred to have a /help GET endpoint for a helpful usage example.

Installation Requirements

  • make sure Rust and Cargo are installed
  • before running the rust-bert model, you need to install the correct version of Libtorch. See manually installed dependencies and relevant links below for this specific model and documentation.

Usage

Use an HTTP request tool to test the samurai.
curl -X POST -d "<text to summarize>" https://localhost:7878/summarize

Built with

Manually installed dependencies

  • Libtorch 2.1.0 download here. correct version is super important.

Relevant links and resources

About

summary samurai with rust-bert and axum

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages