docs: public-ready English repo — README, docs/benchmarks, MIT license, gofmt
This commit is contained in:
@@ -26,8 +26,8 @@ func TestF32BitsToF16(t *testing.T) {
|
||||
{"neginf", 0xff800000, 0xfc00},
|
||||
{"qnan", 0x7fc00000, 0x7e00},
|
||||
{"snan", 0x7f800001, 0x7e00},
|
||||
{"min_normal", 0x38800000, 0x0400}, // 2^-14
|
||||
{"min_subnormal", 0x33800000, 0x0001}, // 2^-24
|
||||
{"min_normal", 0x38800000, 0x0400}, // 2^-14
|
||||
{"min_subnormal", 0x33800000, 0x0001}, // 2^-24
|
||||
{"tie_to_even_zero", 0x33000000, 0x0000}, // 2^-25 (half of min subnormal)
|
||||
{"tie_to_even_two", 0x33c00000, 0x0002}, // 3 * 2^-25
|
||||
{"one_tenth", 0x3dcccccd, 0x2e66},
|
||||
|
||||
+18
-18
@@ -14,23 +14,23 @@ import (
|
||||
)
|
||||
|
||||
type hfConfigFile struct {
|
||||
ModelType string `json:"model_type"`
|
||||
HiddenSize int64 `json:"hidden_size"`
|
||||
NumHiddenLayers int64 `json:"num_hidden_layers"`
|
||||
NumAttentionHeads int64 `json:"num_attention_heads"`
|
||||
NumKeyValueHeads int64 `json:"num_key_value_heads"`
|
||||
HeadDim int64 `json:"head_dim"`
|
||||
IntermediateSize int64 `json:"intermediate_size"`
|
||||
VocabSize int64 `json:"vocab_size"`
|
||||
MaxPositionEmbeddings int64 `json:"max_position_embeddings"`
|
||||
ModelType string `json:"model_type"`
|
||||
HiddenSize int64 `json:"hidden_size"`
|
||||
NumHiddenLayers int64 `json:"num_hidden_layers"`
|
||||
NumAttentionHeads int64 `json:"num_attention_heads"`
|
||||
NumKeyValueHeads int64 `json:"num_key_value_heads"`
|
||||
HeadDim int64 `json:"head_dim"`
|
||||
IntermediateSize int64 `json:"intermediate_size"`
|
||||
VocabSize int64 `json:"vocab_size"`
|
||||
MaxPositionEmbeddings int64 `json:"max_position_embeddings"`
|
||||
RopeTheta float64 `json:"rope_theta"`
|
||||
RMSNormEps float64 `json:"rms_norm_eps"`
|
||||
TieWordEmbeddings bool `json:"tie_word_embeddings"`
|
||||
QKNorm bool `json:"qk_norm"`
|
||||
QKNormGain bool `json:"qk_norm_gain"`
|
||||
EmbeddingNorm bool `json:"embedding_norm"`
|
||||
SlidingWindow int64 `json:"sliding_window"`
|
||||
SWAFullEvery int64 `json:"swa_full_every"`
|
||||
TieWordEmbeddings bool `json:"tie_word_embeddings"`
|
||||
QKNorm bool `json:"qk_norm"`
|
||||
QKNormGain bool `json:"qk_norm_gain"`
|
||||
EmbeddingNorm bool `json:"embedding_norm"`
|
||||
SlidingWindow int64 `json:"sliding_window"`
|
||||
SWAFullEvery int64 `json:"swa_full_every"`
|
||||
}
|
||||
|
||||
func findKV(kvs []rawKV, key string) (rawKV, bool) {
|
||||
@@ -100,9 +100,9 @@ func validateConfig(path string, kvs []rawKV) error {
|
||||
}
|
||||
|
||||
type tokConfigFile struct {
|
||||
EOSToken string `json:"eos_token"`
|
||||
ModelMaxLen int64 `json:"model_max_length"`
|
||||
ChatTemplate string `json:"chat_template"`
|
||||
EOSToken string `json:"eos_token"`
|
||||
ModelMaxLen int64 `json:"model_max_length"`
|
||||
ChatTemplate string `json:"chat_template"`
|
||||
AddedDecoders map[string]struct {
|
||||
Content string `json:"content"`
|
||||
} `json:"added_tokens_decoder"`
|
||||
|
||||
@@ -90,9 +90,9 @@ func (t ggufBType) size() int {
|
||||
type rawKV struct {
|
||||
Key string
|
||||
BType ggufBType
|
||||
Int int64 // integer/bool scalars
|
||||
Float float64 // float scalars
|
||||
Str string // string scalars
|
||||
Int int64 // integer/bool scalars
|
||||
Float float64 // float scalars
|
||||
Str string // string scalars
|
||||
ElemType ggufBType // arrays: element type
|
||||
Count uint64 // arrays: element count
|
||||
Raw []byte // arrays: concatenated element bytes (excludes elem_type+count)
|
||||
|
||||
Reference in New Issue
Block a user