demo: llama2-c

This commit is contained in:
xushiwei
2024-05-07 18:42:53 +08:00
parent 073cac8530
commit 79b11b9f51
5 changed files with 143 additions and 11 deletions

View File

@@ -34,17 +34,15 @@ loop: // parse command line arguments
switch c.Getopt(c.Argc, c.Argv, c.Str("m:")) {
case 'm':
checkpointPath = c.Optarg
c.Fprintf(c.Stderr, c.Str("use model: %s\n"), checkpointPath)
c.Fprintf(c.Stderr, c.Str("==> use model: %s\n"), checkpointPath)
case -1:
break loop
}
}
/*
if c.Optind < c.Argc {
prompt = c.Index(c.Argv, c.Optind)
c.Fprintf(c.Stderr, c.Str("prompt: %s\n"), prompt)
}
*/
if c.Optind < c.Argc {
prompt = c.Index(c.Argv, c.Optind)
c.Fprintf(c.Stderr, c.Str("==> prompt: %s\n"), prompt)
}
// build the Transformer via the model .bin file
var transformer llama2.Transformer