6 个版本
新版本 0.3.2 | 2024 年 8 月 14 日 |
---|---|
0.3.1 | 2024 年 8 月 13 日 |
0.2.1 | 2024 年 2 月 28 日 |
0.1.0 | 2023 年 12 月 16 日 |
#762 在 机器学习
每月 419 次下载
用于 11 个 crate (8 个直接使用)
295KB
7K SLoC
语言模型
本 crate 提供语言模型的一个统一接口。它支持流式文本、采样和嵌入。
使用示例(与 RPhi 实现crate一起使用)
use kalosm::language::*;
#[tokio::main]
async fn main() {
let mut model = Llama::phi_3().await.unwrap();
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}");
}
}
依赖项
~31–49MB
~796K SLoC