feat: support safetensors export in convert mode (#1444)

This commit is contained in:
leejet authored and GitHub committed 2026-04-20 00:22:11 +08:00
1 parent 0a7ae07f94
commit 44cca3d626
10 files changed
+257 -120

No files matched your search

+3 -1
View File
@@ -189,6 +189,9 @@ enum PMVersion {
};
typedef OrderedMap<std::string, TensorStorage> String2TensorStorage;
using TensorTypeRules = std::vector<std::pair<std::string, ggml_type>>;
TensorTypeRules parse_tensor_type_rules(const std::string& tensor_type_rules);
class ModelLoader {
protected:
@@ -231,7 +234,6 @@ public:
return names;
}
bool save_to_gguf_file(const std::string& file_path, ggml_type type, const std::string& tensor_type_rules);
bool tensor_should_be_converted(const TensorStorage& tensor_storage, ggml_type type);
int64_t get_params_mem_size(ggml_backend_t backend, ggml_type type = GGML_TYPE_COUNT);
~ModelLoader() = default;