cli add about gguf param

This commit is contained in:
jhqxxx
2026-03-17 15:39:34 +08:00
parent 80d36b5308
commit fb4a50f745
19 changed files with 403 additions and 104 deletions
+20
View File
@@ -10,12 +10,32 @@
use anyhow::Result;
// use byteorder::{LittleEndian, ReadBytesExt};
use candle_core::Tensor;
use modelscope::{DownloadOptions, ModelScope};
// use sentencepiece::SentencePieceProcessor;
// use zip::ZipArchive;
#[tokio::test]
async fn download_test() -> Result<()> {
// cargo test -F cuda --test messy_test download_test -r -- --nocapture
let model_id = "unsloth/Qwen3.5-4B-GGUF";
let model_name = "Qwen3.5-4B-IQ4_NL.gguf";
let save_dir =
aha::utils::get_default_save_dir().ok_or(anyhow::anyhow!("Failed to get save dir"))?;
let _ = ModelScope::download_with_options(
model_id,
save_dir,
DownloadOptions {
files: (vec![model_name.to_string()]).into(),
},
)
.await;
Ok(())
}
#[test]
fn messy_test() -> Result<()> {
// RUST_BACKTRACE=1 cargo test -F cuda --test messy_test messy_test -r -- --nocapture
let device = &candle_core::Device::Cpu;
let t1 = Tensor::randn(0.0, 1.0, (16, 9, 64, 128), device)?;
let t2 = Tensor::randn(0.0, 1.0, (16, 9, 128, 64), device)?;
+7 -1
View File
@@ -9,13 +9,19 @@ use anyhow::Result;
#[test]
fn gguf_test() -> Result<()> {
// RUST_BACKTRACE=1 cargo test -r -F cuda --test test_gguf_qwen3_5 gguf_test -- --nocapture
// let model_path = "/home/jhq/.aha/Qwen/Qwen3.5-4B-GGUF/Qwen3.5-4B-Q5_K_M.gguf"; // 有问题
// let model_path = "/home/jhq/.aha/Qwen/Qwen3.5-4B-GGUF/Qwen3.5-4B-Q6_K.gguf"; // 有问题
// let mmproj_path = "/home/jhq/.aha/Qwen/Qwen3.5-4B-GGUF/mmproj-F16.gguf";
// let model_path = "/home/jhq/.aha/Qwen/Qwen3.5-2B-GGUF/Qwen3.5-2B-Q6_K.gguf";
// let mmproj_path = "/home/jhq/.aha/Qwen/Qwen3.5-2B-GGUF/mmproj-F16.gguf";
let model_path = "/home/jhq/.aha/Qwen/Qwen3.5-0.8B-GGUF/Qwen3.5-0.8B-Q4_K_M.gguf";
let mmproj_path = "/home/jhq/.aha/Qwen/Qwen3.5-0.8B-GGUF/mmproj-F16.gguf";
// let mut model_file = std::fs::File::open(model_path)?;
// let model = gguf_file::Content::read(&mut model_file)?;
// for (key, value) in model.tensor_infos {
// if key.contains("blk.12.") {
// println!("{key}: {:#?}", value);
// }
// }
// for (key, value) in model.metadata {
// if key.contains("tokeni") {
// continue;