3 unstable releases
0.2.1 | Feb 28, 2024 |
---|---|
0.2.0 | Feb 18, 2024 |
0.1.0 | Dec 16, 2023 |
#858 in Machine learning
85 downloads per month
Used in 7 crates
(6 directly)
225KB
6K
SLoC
Language Model
This crate provides a unified interface for language models. It supports streaming text, sampling, and embedding.
Usage (with the RPhi implementation crate)
use rphi::prelude::*;
#[tokio::main]
async fn main() {
let mut model = Phi::default();
let prompt = "The capital of France is ";
let mut result = model.stream_text(prompt).await.unwrap();
print!("{prompt}");
while let Some(token) = result.next().await {
print!("{token}");
}
}
Dependencies
~29–45MB
~835K SLoC