We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c1430d commit 440c636Copy full SHA for 440c636
llama-cpp-2/src/model.rs
@@ -549,7 +549,7 @@ impl LlamaModel {
549
if res > buff.len() as i32 {
550
return Err(ApplyChatTemplateError::BuffSizeError);
551
}
552
- String::from_utf8(buff.iter().filter(|c| **c > 0).map(|&c| c as u8).collect())
+ Ok::<String, ApplyChatTemplateError>(CStr::from_ptr(buff.as_mut_ptr()).to_string_lossy().to_string())
553
}?;
554
Ok(formatted_chat)
555
0 commit comments