]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
Add pipe input for prompt on gpt examples (#38)
authorhidenorly <redacted>
Wed, 22 Mar 2023 19:43:22 +0000 (04:43 +0900)
committerGitHub <redacted>
Wed, 22 Mar 2023 19:43:22 +0000 (21:43 +0200)
commit084ba0919bee971ddd3dd7455f5de50ad28bb6ad
treee42f617679df9f404694c851c4e9fb035a9d914b
parent4c2f924553312c490e79e6e1739c6f4aa9bbd450
Add pipe input for prompt on gpt examples (#38)

Enable prompt input through pipe, instead of using -p option.
This makes easier to give longer and multiple lines for the prompt.

Test:
 $ echo "This is an example" > prompt.txt
 $ cat prompt.txt | ./bin/gpt-j -m models/gpt-j-6B/ggml-model.bin
 $ cat promot.txt | ./bin/gpt-2 -m models/gpt-2-117M/ggml-model.bin

Note that -p option and no -p specified case are kept.
 $ ./bin/gpt-j -m models/gpt-j-6B/ggml-model.bin -p "This is an example"
 $ ./bin/gpt-j -m models/gpt-j-6B/ggml-model.bin
 $ ./bin/gpt-2 -m models/gpt-2-117M/ggml-model.bin -p "This is an example"
 $ ./bin/gpt-2 -m models/gpt-2-117M/ggml-model.bin
examples/gpt-2/main.cpp
examples/gpt-j/README.md
examples/gpt-j/main.cpp