You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some app like ggml/yolov3-tiny needs additional files to execute such as label(coco.names) and alphabet labels(100_0.png, ...) files.
If these files are embedded to a model(gguf) file and the app read them from the model file, the app is more portable.
I added below
expanded gguf-py to support NAMEDOBJECT, constants.py, gguf_reader.py, gguf_writer.py
please see pull request to llama.cpp
added gguf-addfile.py script to add files to gguf file
add files as NAMEDOBJECT (general.namedobject.N) or add files as NAMEDOBJECT array (general.namedobject[N] with --array option)
added new GGUF_TYPE_NAMEDOBJECT with name(file path) and value(file body) for adding files to gguf
expanded ggml to support NAMEDOBJECT, ggml.h ggml.c
expanded yolov3-tiny to read coco.names and alphabet labels from gguf file,
at first read from gguf, then read from file if failed from gguf
NAMEDOBJECT constructed from name(file path) and value(file body)
struct gguf_nobj {
uint64_t nname; // length of name
char * name; // name in utf8
uint64_t n; // length of data in bytes
char * data; // data body (file body)
};
store the file path as key with starting '/' to avoid from conflicts to other key names.
ex. storing file 'data/coco.names' as '/data/coco.names'
if storing absolute file path '/a/b/c' as '//a/b/c'
store the file contents as GGUF_TYPE_STRING's value.
So, I deleted all NAMEDOBJECT part.
I wrote script based on gguf-new-metadata.py.
I deleted dump code from gguf-addfile.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
help wantedNeeds help from the communitypythonpython script changesReview Complexity : MediumGenerally require more time to grok but manageable by beginner to medium expertise level
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see Embed yolo files 831 ggml-org/ggml#831
Some app like ggml/yolov3-tiny needs additional files to execute such as label(coco.names) and alphabet labels(100_0.png, ...) files.
If these files are embedded to a model(gguf) file and the app read them from the model file, the app is more portable.
I added below
see ggml ggml-org/ggml#831
NAMEDOBJECT constructed from name(file path) and value(file body)
script usage: