Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: karthik2804 <[email protected]>
  • Loading branch information
karthik2804 committed Sep 13, 2024
1 parent 2e6bf15 commit 611f2b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/llm-local/src/llama.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use tokenizers::Tokenizer;
const TOKENIZER_FILENAME: &str = "tokenizer.json";
const CONFIG_FILENAME: &str = "config.json";
const EOS_TOKEN: &str = "</s>";
const MODEL_SAFETENSORS_INDEX: &str = "model.safetensors.index.json";
const MODEL_SAFETENSORS_INDEX_FILE: &str = "model.safetensors.index.json";

pub fn auto_device() -> Result<Device> {
if utils::cuda_is_available() {
Expand Down Expand Up @@ -51,7 +51,7 @@ impl LlamaModels {
let config = config.into_config(false);
let cache = llama::Cache::new(true, dtype, &config, &device)?;

let safetensor_files = load_safetensors(&model_dir, MODEL_SAFETENSORS_INDEX)?;
let safetensor_files = load_safetensors(model_dir, MODEL_SAFETENSORS_INDEX_FILE)?;

// TODO: Check if there is a safe way to load the model from the file
let vb = unsafe { VarBuilder::from_mmaped_safetensors(&safetensor_files, dtype, &device)? };
Expand Down

0 comments on commit 611f2b2

Please sign in to comment.