Skip to content

Commit

Permalink
🔥 removes token output stream to use it from candle examples
Browse files Browse the repository at this point in the history
  • Loading branch information
chriamue committed Dec 25, 2023
1 parent 1ab092d commit e37fdc6
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 89 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ path = "src/main.rs"
anyhow = "1.0"
axum = "0.7"
candle-core = "0.3.2"
candle-examples = "0.3.2"
candle-transformers = "0.3.2"
clap = { version = "4.4", features = ["derive"] }
futures = "0.3.29"
Expand Down
1 change: 0 additions & 1 deletion src/llm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pub mod sampler;
mod text_generation;
pub mod text_generator;
pub mod token_generator;
pub mod token_output_stream;

pub use text_generator::TextGeneratorTrait;

Expand Down
2 changes: 1 addition & 1 deletion src/llm/text_generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::{
use crate::llm::generate_parameter::GenerateParameter;
use anyhow::Result;
use candle_core::Device;
use candle_examples::token_output_stream::TokenOutputStream;
use candle_transformers::{generation::LogitsProcessor, models::quantized_llama::ModelWeights};
use futures::Stream;
use log::{info, trace};
Expand All @@ -17,7 +18,6 @@ use tokio_stream::wrappers::ReceiverStream;
use super::{
text_generator::{self, TextGenerator},
token_generator::{TokenGenerator, TokenGeneratorTrait},
token_output_stream::TokenOutputStream,
TextGeneratorTrait,
};

Expand Down
2 changes: 1 addition & 1 deletion src/llm/text_generator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use super::{
token_generator::{TokenGeneratorResult, TokenGeneratorTrait},
token_output_stream::TokenOutputStream,
FinishReason,
};
use anyhow::Result;
use candle_examples::token_output_stream::TokenOutputStream;
mod dummy_text_generator;

pub type TextProbability = (String, f32);
Expand Down
86 changes: 0 additions & 86 deletions src/llm/token_output_stream.rs

This file was deleted.

0 comments on commit e37fdc6

Please sign in to comment.