Remove deprecated Flash preview and legacy MTP
This commit is contained in:
1 parent
7f88e23884
commit
0fa15bb68b
24 files changed
+246
-1200
No files matched your search
+23
-40
@@ -330,50 +330,33 @@ mod tests {
|
||||
Some(ModelChoice::DeepSeekV4Flash0731)
|
||||
);
|
||||
assert!(ModelChoice::from_id("unknown").is_none());
|
||||
assert_eq!(
|
||||
ModelChoice::DeepSeekV4Flash.main_artifact().size,
|
||||
86_720_111_488
|
||||
);
|
||||
assert_eq!(MODEL_CHOICES.len(), 3);
|
||||
assert_eq!(MANAGED_ARTIFACTS.len(), 4);
|
||||
assert_eq!(ModelChoice::Glm52.main_artifact().size, 211_075_856_448);
|
||||
assert_eq!(
|
||||
ModelChoice::DeepSeekV4Flash0731.main_artifact().size,
|
||||
86_720_111_488
|
||||
);
|
||||
assert_eq!(
|
||||
ModelChoice::DeepSeekV4Flash.artifacts(true, true).count(),
|
||||
3
|
||||
);
|
||||
assert_eq!(ModelChoice::Glm52.artifacts(true, true).count(), 1);
|
||||
assert_eq!(
|
||||
ModelChoice::DeepSeekV4Flash0731
|
||||
.artifacts(true, true)
|
||||
.count(),
|
||||
2
|
||||
);
|
||||
assert_eq!(ModelChoice::DeepSeekV4Flash0731.artifacts(true).count(), 2);
|
||||
assert_eq!(ModelChoice::Glm52.artifacts(true).count(), 1);
|
||||
|
||||
let id = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.as_nanos();
|
||||
let models_path = std::env::temp_dir().join(format!("ds4-server-models-{id}"));
|
||||
let engine = engine_artifacts(ModelChoice::DeepSeekV4Flash, false, true, &models_path);
|
||||
let engine = engine_artifacts(ModelChoice::DeepSeekV4Flash0731, true, &models_path);
|
||||
assert_eq!(
|
||||
engine.model.file_name(),
|
||||
Some(std::ffi::OsStr::new(FLASH.file_name))
|
||||
Some(std::ffi::OsStr::new(FLASH_0731.file_name))
|
||||
);
|
||||
assert_eq!(
|
||||
engine.mtp.as_deref().and_then(Path::file_name),
|
||||
Some(std::ffi::OsStr::new(FLASH_DSPARK.file_name))
|
||||
);
|
||||
let flash_0731 =
|
||||
engine_artifacts(ModelChoice::DeepSeekV4Flash0731, false, true, &models_path);
|
||||
assert_eq!(
|
||||
flash_0731.mtp.as_deref().and_then(Path::file_name),
|
||||
engine.support.as_deref().and_then(Path::file_name),
|
||||
Some(std::ffi::OsStr::new(FLASH_0731_DSPARK.file_name))
|
||||
);
|
||||
assert!(
|
||||
engine_artifacts(ModelChoice::DeepSeekV4Flash0731, true, false, &models_path)
|
||||
.mtp
|
||||
engine_artifacts(ModelChoice::DeepSeekV4Flash0731, false, &models_path)
|
||||
.support
|
||||
.is_none()
|
||||
);
|
||||
let empty = Artifact {
|
||||
@@ -384,18 +367,20 @@ mod tests {
|
||||
sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
support: None,
|
||||
};
|
||||
let partial = empty.partial_path(ModelChoice::DeepSeekV4Flash, &models_path);
|
||||
let partial = empty.partial_path(ModelChoice::DeepSeekV4Flash0731, &models_path);
|
||||
fs::create_dir_all(partial.parent().unwrap()).unwrap();
|
||||
fs::write(&partial, []).unwrap();
|
||||
download_artifact(ModelChoice::DeepSeekV4Flash, &empty, &models_path).unwrap();
|
||||
assert!(empty.is_installed(ModelChoice::DeepSeekV4Flash, &models_path));
|
||||
download_artifact(ModelChoice::DeepSeekV4Flash0731, &empty, &models_path).unwrap();
|
||||
assert!(empty.is_installed(ModelChoice::DeepSeekV4Flash0731, &models_path));
|
||||
assert!(!partial.exists());
|
||||
assert_eq!(
|
||||
fs::read_to_string(empty.verification_path(ModelChoice::DeepSeekV4Flash, &models_path))
|
||||
.unwrap(),
|
||||
fs::read_to_string(
|
||||
empty.verification_path(ModelChoice::DeepSeekV4Flash0731, &models_path)
|
||||
)
|
||||
.unwrap(),
|
||||
empty.sha256
|
||||
);
|
||||
let installed = empty.path(ModelChoice::DeepSeekV4Flash, &models_path);
|
||||
let installed = empty.path(ModelChoice::DeepSeekV4Flash0731, &models_path);
|
||||
assert!(empty.validate_installed_path(&installed).is_ok());
|
||||
let wrong_name = installed.with_file_name("wrong-checkpoint.gguf");
|
||||
fs::write(&wrong_name, []).unwrap();
|
||||
@@ -405,10 +390,9 @@ mod tests {
|
||||
validate_engine_artifacts(
|
||||
ModelChoice::DeepSeekV4Flash0731,
|
||||
true,
|
||||
false,
|
||||
&EngineArtifacts {
|
||||
model: installed.clone(),
|
||||
mtp: None,
|
||||
support: None,
|
||||
},
|
||||
)
|
||||
.is_err()
|
||||
@@ -416,11 +400,10 @@ mod tests {
|
||||
assert!(
|
||||
validate_engine_artifacts(
|
||||
ModelChoice::DeepSeekV4Pro,
|
||||
false,
|
||||
true,
|
||||
&EngineArtifacts {
|
||||
model: installed,
|
||||
mtp: None,
|
||||
support: None,
|
||||
},
|
||||
)
|
||||
.is_err()
|
||||
@@ -452,7 +435,7 @@ mod tests {
|
||||
verify(
|
||||
&path,
|
||||
&artifact,
|
||||
ModelChoice::DeepSeekV4Flash,
|
||||
ModelChoice::DeepSeekV4Flash0731,
|
||||
&AtomicBool::new(false),
|
||||
&verified_bytes,
|
||||
)
|
||||
@@ -472,7 +455,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.as_nanos()
|
||||
));
|
||||
let id = ManagedArtifactId::DeepSeekV4Flash;
|
||||
let id = ManagedArtifactId::DeepSeekV4Flash0731;
|
||||
let partial = id.artifact().partial_path(id.model(), &models_path);
|
||||
fs::create_dir_all(partial.parent().unwrap()).unwrap();
|
||||
fs::write(&partial, b"part").unwrap();
|
||||
@@ -611,14 +594,14 @@ mod tests {
|
||||
sha256: "unused",
|
||||
support: None,
|
||||
};
|
||||
let partial = artifact.partial_path(ModelChoice::DeepSeekV4Flash, &directory);
|
||||
let partial = artifact.partial_path(ModelChoice::DeepSeekV4Flash0731, &directory);
|
||||
fs::create_dir_all(partial.parent().unwrap()).unwrap();
|
||||
fs::write(&partial, b"part").unwrap();
|
||||
let cancel = AtomicBool::new(true);
|
||||
|
||||
assert_eq!(
|
||||
download_artifact_with_cancel(
|
||||
ModelChoice::DeepSeekV4Flash,
|
||||
ModelChoice::DeepSeekV4Flash0731,
|
||||
&artifact,
|
||||
&directory,
|
||||
&cancel,
|
||||
|
||||
Reference in new issue
Block a user