Skip to content

Commit

Permalink
style fix again
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuk committed Mar 14, 2024
1 parent 5e6deaa commit ac0099f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/llm-chain-gemma/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ impl GemmaContext {
// Typically the downloaded model data is compressed and set as cache.
// TODO: consider the case of non-compressed one?
let path = m.to_path();
gcpp_LoaderArgs_SetCache(largs, path.as_ptr() as *const i8, path.len() as ffi::c_uint);
gcpp_LoaderArgs_SetCache(
largs,
path.as_ptr() as *const i8,
path.len() as ffi::c_uint,
);
// TODO: consider adding the option for tokenizer file.
let parent = Path::new(&path).parent();
if parent.is_none() {
Expand All @@ -54,7 +58,11 @@ impl GemmaContext {
)));
}
if let Some(tokenizer_path) = parent.unwrap().join("tokenizer.spm").to_str() {
gcpp_LoaderArgs_SetTokenizer(largs, tokenizer_path.as_ptr() as *const i8, tokenizer_path.len() as ffi::c_uint);
gcpp_LoaderArgs_SetTokenizer(
largs,
tokenizer_path.as_ptr() as *const i8,
tokenizer_path.len() as ffi::c_uint,
);
} else {
return Err(ExecutorCreationError::InvalidValue(String::from(
"conversion from path to str for tokenizer",
Expand Down

0 comments on commit ac0099f

Please sign in to comment.