WerWolv / ImHex-Patterns

Hex patterns, include patterns and magic files for the use with the ImHex Hex Editor
https://github.com/WerWolv/ImHex
GNU General Public License v2.0
641 stars 170 forks source link

(feat) add gguf pattern #235

Closed leonjza closed 5 months ago

leonjza commented 5 months ago

Add's a pattern for GGUF formatted models. Ref: https://github.com/ggerganov/ggml/blob/master/docs/gguf.md

I: Pattern exited with code: 0
I: Evaluation took 1.17247s

A sample file can be grabbed from hugging face here: https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v0.6/blob/main/ggml-model-q4_0.gguf

image
WerWolv commented 5 months ago

Hey! Thanks a lot! Could you please also add your pattern to the table in the readme and (if possible) upload a small test file to tests/patterns/test_data so the CI can run against it and make sure it doesn't break in the future?

leonjza commented 5 months ago

Added a test file. It's a LLama2 model with the tensor data truncated (which is just a blob where a structure has an offset to read data from and not needed for parsing). The newline / "unrelated" changes in the README is a markdownlint run. Let me know if you'd prefer I remove those.

        Start  36: Patterns/gguf.hexpat/gguf.hexpat.gguf
 36/145 Test  #36: Patterns/gguf.hexpat/gguf.hexpat.gguf ..........................   Passed    9.04 sec
WerWolv commented 5 months ago

Thank you!