3 Metadata Override
Brian edited this page 2024-07-23 00:39:39 +10:00

https://github.com/ggerganov/llama.cpp/pull/7499 was added which adds --metadata metadata override feature so you can add extra metadata to the gguf file. The metadata override files may look like below (Note that // c style comment is not present in the actual file, but is there for illustrative purpose)

{
    // Example Metadata Override Fields
    "general.name"           : "Example Model Six",
    "general.author"         : "John Smith",
    "general.version"        : "v1.0",
    "general.organization"   : "SparkExampleMind",
    "general.quantized_by"   : "Abbety Jenson",
    "general.description"    : "This is an example of a model",
    // Useful for cleanly regenerating default naming conventions
    "general.finetune"       : "instruct",
    "general.basename"       : "llamabase",
    "general.size_label"     : "8x2.3Q",
    // Licensing details
    "general.license"        : "apache-2.0",
    "general.license.name"   : "Apache License Version 2.0, January 2004",
    "general.license.link"   : "https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md",
    // Typically represents the converted GGUF repo (Unless native)
    "general.url"            : "https://huggingface.co/SparkExampleMind/llamabase-8x2.3Q-instruct-v1.0-F16/blob/main/README.md",
    "general.doi"            : "doi:10.1080/02626667.2018.1560449", 
    "general.uuid"           : "f18383df-ceb9-4ef3-b929-77e4dc64787c", 
    "general.repo_url"       : "https://huggingface.co/SparkExampleMind/llamabase-8x2.3Q-instruct-v1.0-F16",
    // Model Source during conversion
    "general.source.url"     : "https://huggingface.co/SparkExampleMind/llamabase-8x2.3Q-instruct-v1.0-safetensor/blob/main/README.md",
    "general.source.doi"     : "doi:10.1080/02626667.2018.1560449", 
    "general.source.uuid"    : "a72998bf-3b84-4ff4-91c6-7a6b780507bc", 
    "general.source.repo_url": "https://huggingface.co/SparkExampleMind/llamabase-8x2.3Q-instruct-v1.0-safetensor",
    // Model Parents (Merges, Pre-tuning, etc...)
    "general.base_models"    : [
        {
            "name" : "base model example" ,
            "author" : "example parent" ,
            "version" : "v3.2" ,
            "organization" : "grandOldMaster" ,
            "url" : "https://huggingface.co/SparkExampleMind/parentlalama-1Q-v1.0-safetensor/blob/main/README.md",
            "doi" : "doi:10.1080/02626667.2018.1560449",
            "uuid" : "52d8c7ef-1de5-43f1-87a4-0c7c9c3d07c4" ,
            "repo_url" : "https://huggingface.co/SparkExampleMind/parentlalama-1Q-v1.0-safetensor"
        }
    ],
    // Array based metadata
    "general.tags": ["text generation", "transformer", "llama", "tiny", "tiny model"],
    "general.languages": ["en"],
    "general.datasets": ["https://huggingface.co/datasets/roneneldan/TinyStories/blob/main/TinyStoriesV2-GPT4-train.txt", "https://huggingface.co/datasets/roneneldan/TinyStories/blob/main/TinyStoriesV2-GPT4-valid.txt"]
}