Align DeepSeek and GLM execution with DS4

This commit is contained in:
Georg Bauer
2026-09-11 17:18:45 +02:00
parent 02db0968ae
commit 48c2f751b4
27 changed files with 4517 additions and 400 deletions
+7 -2
View File
@@ -3,6 +3,7 @@ use sha2::{Digest, Sha256};
use std::collections::HashMap;
use std::fs::File;
use std::path::{Path, PathBuf};
use std::sync::Arc;
const MAGIC: u32 = 0x4655_4747;
const MAX_COUNT: u64 = 1_000_000;
@@ -48,7 +49,7 @@ pub(super) struct Tensor {
pub(super) struct Gguf {
path: PathBuf,
map: Mmap,
map: Arc<Mmap>,
data_offset: u64,
max_tensor_bytes: u64,
pub(super) metadata: HashMap<String, Value>,
@@ -169,7 +170,7 @@ impl Gguf {
Ok(Self {
path: path.to_owned(),
map,
map: Arc::new(map),
data_offset: data_start,
max_tensor_bytes,
metadata,
@@ -215,6 +216,10 @@ impl Gguf {
self.map.as_ptr()
}
pub(super) fn shared_map(&self) -> Arc<Mmap> {
Arc::clone(&self.map)
}
pub(super) fn data_offset(&self) -> u64 {
self.data_offset
}