mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-27 04:53:38 +00:00
Fix the Clippy warnings in the runtime
This commit is contained in:
parent
2c212f75f6
commit
1bf11c0ca7
@ -415,10 +415,10 @@ fn take_released(held: &mut VecDeque<(u64, Chunk)>, released: Vec<(u64, String)>
|
||||
// treats a missing count as "not counted yet" and counts that segment itself, so the
|
||||
// document still arrives complete.
|
||||
//
|
||||
if let Some(tokenizer) = tokenizer {
|
||||
if let Err(e) = segment.set_token_count(tokenizer) {
|
||||
warn!("Failed to count the tokens of a released chunk: {e}");
|
||||
}
|
||||
if let Some(tokenizer) = tokenizer
|
||||
&& let Err(e) = segment.set_token_count(tokenizer)
|
||||
{
|
||||
warn!("Failed to count the tokens of a released chunk: {e}");
|
||||
}
|
||||
|
||||
chunks.push(segment);
|
||||
|
||||
@ -178,7 +178,7 @@ fn validate_tokenizer_file(path: &PathBuf) -> Result<usize, String> {
|
||||
fn handle_tokenizer_store(payload: &TokenizerStorage) -> Result<String, std::io::Error> {
|
||||
let data_dir = DATA_DIRECTORY
|
||||
.get()
|
||||
.ok_or_else(|| std::io::Error::new(std::io::ErrorKind::Other, "DATA_DIRECTORY not initialized"))?;
|
||||
.ok_or_else(|| std::io::Error::other("DATA_DIRECTORY not initialized"))?;
|
||||
|
||||
let base_path = PathBuf::from(data_dir).join("tokenizers");
|
||||
|
||||
@ -219,7 +219,7 @@ fn handle_tokenizer_delete(payload: &TokenizerDelete) -> Result<(), std::io::Err
|
||||
|
||||
let data_dir = DATA_DIRECTORY
|
||||
.get()
|
||||
.ok_or_else(|| std::io::Error::new(std::io::ErrorKind::Other, "DATA_DIRECTORY not initialized"))?;
|
||||
.ok_or_else(|| std::io::Error::other("DATA_DIRECTORY not initialized"))?;
|
||||
|
||||
let tokenizer_path = PathBuf::from(data_dir)
|
||||
.join("tokenizers")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user