Skip to content

Commit

Permalink
test: update action version
Browse files Browse the repository at this point in the history
Signed-off-by: YdrMaster <ydrml@hotmail.com>
  • Loading branch information
YdrMaster committed Feb 13, 2024
1 parent 3e529c8 commit 23ee215
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check format
run: cargo fmt --check
Expand All @@ -46,7 +46,7 @@ jobs:
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true
14 changes: 14 additions & 0 deletions model-parameters/src/safe_tensors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,17 @@ impl SafeTensors {
})
}
}

#[test]
fn test_load() {
use std::time::Instant;
let t0 = Instant::now();
let safetensors = SafeTensors::new("../../TinyLlama-1.1B-Chat-v1.0");
let t1 = Instant::now();
println!("{:?}", t1 - t0);
match safetensors {
Ok(_) => {}
Err(SafeTensorError::Io(e)) if e.kind() == std::io::ErrorKind::NotFound => {}
Err(e) => panic!("{:?}", e),
}
}
2 changes: 1 addition & 1 deletion tokenizer/src/vocab_txt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl VocabTxt {
let mut words = Vec::new();
let mut trie = PatriciaMap::new();
let mut max_piece_len = 0;
for (i, line) in text.lines().into_iter().enumerate() {
for (i, line) in text.lines().enumerate() {
let piece = line.strip_prefix('"').unwrap().strip_suffix('"').unwrap();
max_piece_len = max_piece_len.max(piece.len());
words.push(piece.to_string());
Expand Down

0 comments on commit 23ee215

Please sign in to comment.