]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Fix clang warning in gguf_check_reserved_keys (#12686)
authorR0CKSTAR <redacted>
Tue, 1 Apr 2025 11:12:53 +0000 (19:12 +0800)
committerGitHub <redacted>
Tue, 1 Apr 2025 11:12:53 +0000 (13:12 +0200)
* Fix clang warning in gguf_check_reserved_keys

Signed-off-by: Xiaodong Ye <redacted>
* Fix typo

Signed-off-by: Xiaodong Ye <redacted>
---------

Signed-off-by: Xiaodong Ye <redacted>
common/minja/minja.hpp
ggml/src/gguf.cpp

index fa4c34d6e414a5324e1c64245abd881545ccdaf4..1a30499e744ec6f5cf0ce3fd63ecbfc0e9b3eccf 100644 (file)
@@ -240,7 +240,7 @@ public:
       auto index = key.get<int>();
       return array_->at(index < 0 ? array_->size() + index : index);
     } else if (object_) {
-      if (!key.is_hashable()) throw std::runtime_error("Unashable type: " + dump());
+      if (!key.is_hashable()) throw std::runtime_error("Unhashable type: " + dump());
       auto it = object_->find(key.primitive_);
       if (it == object_->end()) return Value();
       return it->second;
@@ -249,7 +249,7 @@ public:
   }
   void set(const Value& key, const Value& value) {
     if (!object_) throw std::runtime_error("Value is not an object: " + dump());
-    if (!key.is_hashable()) throw std::runtime_error("Unashable type: " + dump());
+    if (!key.is_hashable()) throw std::runtime_error("Unhashable type: " + dump());
     (*object_)[key.primitive_] = value;
   }
   Value call(const std::shared_ptr<Context> & context, ArgumentsValue & args) const {
index ab13669c567feaf279e45973002c5ff78ebedf9c..381a9c7dcbe8f07873c9c06f61e9d2ca43d85628 100644 (file)
@@ -932,6 +932,7 @@ static void gguf_check_reserved_keys(const std::string & key, const T val) {
         if constexpr (std::is_same<T, uint32_t>::value) {
             GGML_ASSERT(val > 0 && (val & (val - 1)) == 0 && GGUF_KEY_GENERAL_ALIGNMENT " must be power of 2");
         } else {
+            GGML_UNUSED(val);
             GGML_ABORT(GGUF_KEY_GENERAL_ALIGNMENT " must be type u32");
         }
     }