Keep runtime files inside application support
This commit is contained in:
@@ -3221,7 +3221,11 @@ mod tests {
|
||||
use crate::engine::{GLM, Model, ReasoningMode};
|
||||
use crate::model::ModelChoice;
|
||||
use crate::settings::EngineSsdSettings;
|
||||
use std::path::Path;
|
||||
|
||||
fn installed_glm_path() -> std::path::PathBuf {
|
||||
crate::model::engine_artifacts(ModelChoice::Glm52, false, false, &crate::app::models_path())
|
||||
.model
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dsa_indexer_schedule_matches_the_reference() {
|
||||
@@ -3258,16 +3262,14 @@ mod tests {
|
||||
#[test]
|
||||
#[ignore = "requires the 197 GiB GLM 5.2 checkpoint and Apple Metal"]
|
||||
fn resident_and_streamed_glm_match_ds4_decode_oracles() {
|
||||
let path = std::env::var("DS4_GLM_MODEL").unwrap_or_else(|_| {
|
||||
"../ds4/models/GLM-5.2-UD-IQ2_XXS_RoutedIQ2XXS_blk78Q2K.gguf".into()
|
||||
});
|
||||
if !Path::new(&path).is_file() {
|
||||
eprintln!("skipping unavailable GLM fixture: {path}");
|
||||
let path = installed_glm_path();
|
||||
if !path.is_file() {
|
||||
eprintln!("skipping unavailable GLM fixture: {}", path.display());
|
||||
return;
|
||||
}
|
||||
let prompt = b"Complete the C statement with the next exact token only:\nreturn snprintf(buf, sizeof(buf), \"%d\", value";
|
||||
for streamed in [false, true] {
|
||||
let model = Model::open_main(Path::new(&path), ModelChoice::Glm52).unwrap();
|
||||
let model = Model::open_main(&path, ModelChoice::Glm52).unwrap();
|
||||
let tokens = model.tokenize(std::str::from_utf8(prompt).unwrap());
|
||||
let executor = GlmExecutor::open(
|
||||
model,
|
||||
@@ -3329,15 +3331,13 @@ mod tests {
|
||||
#[test]
|
||||
#[ignore = "requires the 197 GiB GLM 5.2 checkpoint and Apple Metal"]
|
||||
fn streamed_glm_uses_ds4_indexed_prefill_for_long_prompts() {
|
||||
let path = std::env::var("DS4_GLM_MODEL").unwrap_or_else(|_| {
|
||||
"../ds4/models/GLM-5.2-UD-IQ2_XXS_RoutedIQ2XXS_blk78Q2K.gguf".into()
|
||||
});
|
||||
if !Path::new(&path).is_file() {
|
||||
eprintln!("skipping unavailable GLM fixture: {path}");
|
||||
let path = installed_glm_path();
|
||||
if !path.is_file() {
|
||||
eprintln!("skipping unavailable GLM fixture: {}", path.display());
|
||||
return;
|
||||
}
|
||||
let prompt = "Complete each C statement. Example: return snprintf(buf, sizeof(buf), \"%d\", value); Example: return snprintf(buf, sizeof(buf), \"%d\", value); Example: return snprintf(buf, sizeof(buf), \"%d\", value); Example: return snprintf(buf, sizeof(buf), \"%d\", value); Example: return snprintf(buf, sizeof(buf), \"%d\", value); Now complete exactly: return snprintf(buf, sizeof(buf), \"%d\", value";
|
||||
let model = Model::open_main(Path::new(&path), ModelChoice::Glm52).unwrap();
|
||||
let model = Model::open_main(&path, ModelChoice::Glm52).unwrap();
|
||||
let tokens =
|
||||
model.render_prompt("You are a helpful assistant", prompt, ReasoningMode::Direct);
|
||||
assert_eq!(tokens.len(), 102);
|
||||
@@ -3382,15 +3382,13 @@ mod tests {
|
||||
use crate::settings::EngineSpeculativeSettings;
|
||||
use std::sync::atomic::AtomicBool;
|
||||
|
||||
let path = std::env::var("DS4_GLM_MODEL").unwrap_or_else(|_| {
|
||||
"../ds4/models/GLM-5.2-UD-IQ2_XXS_RoutedIQ2XXS_blk78Q2K.gguf".into()
|
||||
});
|
||||
if !Path::new(&path).is_file() {
|
||||
eprintln!("skipping unavailable GLM fixture: {path}");
|
||||
let path = installed_glm_path();
|
||||
if !path.is_file() {
|
||||
eprintln!("skipping unavailable GLM fixture: {}", path.display());
|
||||
return;
|
||||
}
|
||||
let run = |enabled| {
|
||||
let model = Model::open_main(Path::new(&path), ModelChoice::Glm52).unwrap();
|
||||
let model = Model::open_main(&path, ModelChoice::Glm52).unwrap();
|
||||
let tokens = model.tokenize("Write one short greeting.");
|
||||
let mut executor = GlmExecutor::open_profile(
|
||||
model,
|
||||
|
||||
Reference in New Issue
Block a user