New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gguf] Add types #562
[gguf] Add types #562
Conversation
export type { MetadataValue, Version, GGUFMetadata, GGUFTensorInfo, GGUFParseOutput } from "./types"; | ||
export { GGUFValueType, GGMLQuantizationType } from "./types"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a correct way to re-export ?
export enum GGMLQuantizationType { | ||
F32 = 0, | ||
F16 = 1, | ||
Q4_0 = 2, | ||
Q4_1 = 3, | ||
Q5_0 = 6, | ||
Q5_1 = 7, | ||
Q8_0 = 8, | ||
Q8_1 = 9, | ||
Q2_K = 10, | ||
Q3_K = 11, | ||
Q4_K = 12, | ||
Q5_K = 13, | ||
Q6_K = 14, | ||
Q8_K = 15, | ||
IQ2_XXS = 16, | ||
IQ2_XS = 17, | ||
IQ3_XXS = 18, | ||
IQ1_S = 19, | ||
IQ4_NL = 20, | ||
IQ3_S = 21, | ||
IQ2_S = 22, | ||
IQ4_XS = 23, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enums are not strictly speaking types as they expose objects in the runtime.
End of not super useful pedantic note haha. cc @coyotte508
export type RWKV = ModelBase<"rwkv"> & { "rwkv.architecture_version": number }; | ||
export type LLM = TransformerLLM | RWKV; | ||
export type Whisper = ModelBase<"encoder.whisper"> & ModelBase<"decoder.whisper">; | ||
export type Model = (LLM | Whisper) & Partial<Tokenizer>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very neat types (though they make my head hurt a bit, lol)
"llama", | ||
"mpt", | ||
"gptneox", | ||
"gptj", | ||
"gpt2", | ||
"bloom", | ||
"falcon", | ||
"gemma", | ||
"rwkv", | ||
"whisper", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"llama", | |
"mpt", | |
"gptneox", | |
"gptj", | |
"gpt2", | |
"bloom", | |
"falcon", | |
"gemma", | |
"rwkv", | |
"whisper", | |
"llama", | |
"falcon", | |
"baichuan", | |
"gpt2", | |
"gptj", | |
"gptneox", | |
"mpt", | |
"starcoder", | |
"persimmon", | |
"refact", | |
"bert", | |
"nomic-bert", | |
"bloom", | |
"stablelm", | |
"qwen", | |
"qwen2", | |
"phi2", | |
"plamo", | |
"codeshell", | |
"orion", | |
"internlm2", | |
"minicpm", | |
"gemma", | |
"starcoder2", | |
"mamba", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(optional, but it's the current list from the llama.cpp source of truth IIUC)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would merge as is and iterate later
GGUF add types. Follow up to #540 (comment).
No any kind of validation, just types
cc: @biw also