feat: Quantisierung und Vision-Projektor aus der Datei, Passungsblock mit Abstand, Browserprüfung (#1233, #1234)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -522,20 +522,18 @@ pub(crate) fn scan_models(roots: &[PathBuf]) -> Vec<DiscoveredArtifact> {
|
||||
|
||||
let mut singles = Vec::new();
|
||||
let mut shards: BTreeMap<(PathBuf, String), ShardGroup> = BTreeMap::new();
|
||||
// Vision-Projektoren je Ordner (der erste nach Name), dem Modell dort zugeordnet.
|
||||
let mut projektoren: BTreeMap<PathBuf, PathBuf> = BTreeMap::new();
|
||||
// Vision-Projektoren je Ordner, dem passendsten Modell dort zugeordnet.
|
||||
let mut projektoren: BTreeMap<PathBuf, Vec<PathBuf>> = BTreeMap::new();
|
||||
for (path, _) in &files {
|
||||
let mmproj = path
|
||||
.file_stem()
|
||||
.and_then(|s| s.to_str())
|
||||
.is_some_and(|s| s.to_lowercase().starts_with("mmproj"));
|
||||
.is_some_and(crate::gguf::ist_mmproj);
|
||||
if mmproj && let Some(dir) = path.parent() {
|
||||
let e = projektoren
|
||||
projektoren
|
||||
.entry(dir.to_path_buf())
|
||||
.or_insert_with(|| path.clone());
|
||||
if path < e {
|
||||
*e = path.clone();
|
||||
}
|
||||
.or_default()
|
||||
.push(path.clone());
|
||||
}
|
||||
}
|
||||
|
||||
@ -544,7 +542,7 @@ pub(crate) fn scan_models(roots: &[PathBuf]) -> Vec<DiscoveredArtifact> {
|
||||
continue;
|
||||
};
|
||||
let lower = stem.to_lowercase();
|
||||
if lower.starts_with("mmproj") || lower.contains("vocab") || lower.starts_with("mtp") {
|
||||
if crate::gguf::ist_mmproj(stem) || lower.contains("vocab") || lower.starts_with("mtp") {
|
||||
continue;
|
||||
}
|
||||
match split_shard(stem) {
|
||||
@ -583,7 +581,12 @@ pub(crate) fn scan_models(roots: &[PathBuf]) -> Vec<DiscoveredArtifact> {
|
||||
}
|
||||
}
|
||||
for a in &mut found {
|
||||
a.mmproj = a.path.parent().and_then(|d| projektoren.get(d)).cloned();
|
||||
a.mmproj = a
|
||||
.path
|
||||
.parent()
|
||||
.and_then(|d| projektoren.get(d))
|
||||
.and_then(|liste| crate::gguf::bester_mmproj(&a.name, liste))
|
||||
.cloned();
|
||||
}
|
||||
found.sort_by(|a, b| a.name.cmp(&b.name).then_with(|| a.path.cmp(&b.path)));
|
||||
found
|
||||
@ -634,7 +637,7 @@ fn split_shard(stem: &str) -> Option<(&str, u32, u32)> {
|
||||
|
||||
/// Erkennt die Quantisierung im Dateinamen (zum Beispiel `Q4_K_XL`, `IQ1_S`,
|
||||
/// `BF16`). Liefert `None`, wenn der Name keine erkennbare Angabe enthält.
|
||||
pub(crate) fn parse_quantization(name: &str) -> Option<String> {
|
||||
pub fn parse_quantization(name: &str) -> Option<String> {
|
||||
name.split(['-', '.']).find_map(|token| {
|
||||
let upper = token.to_uppercase();
|
||||
let digit_after = |prefix: &str| {
|
||||
|
||||
Reference in New Issue
Block a user