Skip to content

Commit

Permalink
refactor: versioned cmd
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <[email protected]>
  • Loading branch information
thxCode committed May 30, 2024
1 parent ca3f025 commit 106c3dd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/gguf-parser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func main() {
kvType = "f16"
offloadLayers uint64
// output options
version bool
skipModel bool
skipArchitecture bool
skipTokenizer bool
Expand Down Expand Up @@ -64,6 +65,7 @@ func main() {
fs.IntVar(&ctxSize, "ctx-size", ctxSize, "Context size to estimate memory usage")
fs.StringVar(&kvType, "kv-type", kvType, "Key-Value cache type, select from [f32, f16, q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1]")
fs.Uint64Var(&offloadLayers, "offload-layers", offloadLayers, "Specify how many layers to offload, default is fully offloading")
fs.BoolVar(&version, "version", version, "Show version")
fs.BoolVar(&skipModel, "skip-model", skipModel, "Skip model metadata")
fs.BoolVar(&skipArchitecture, "skip-architecture", skipArchitecture, "Skip architecture metadata")
fs.BoolVar(&skipTokenizer, "skip-tokenizer", skipTokenizer, "Skip tokenizer metadata")
Expand All @@ -75,6 +77,11 @@ func main() {
os.Exit(1)
}

if version {
fmt.Printf("gguf-parser %s\n", Version)
return
}

// Prepare options.

ropts := []GGUFReadOption{
Expand Down

0 comments on commit 106c3dd

Please sign in to comment.