Merge pull request #52 from ravenscroftj/feature/expose-temp-top_p

add temp and top p as cli args
This commit is contained in:
James Ravenscroft 2023-08-23 09:03:28 +01:00 committed by GitHub
commit 1e0d2d3434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,6 @@ int main(int argc, char **argv)
.default_value(4)
.scan<'i', int>();
program.add_argument("-p", "--port")
.help("The tcp port that turbopilot should listen on")
.default_value(18080)
@ -43,6 +42,17 @@ int main(int argc, char **argv)
.default_value(-1)
.scan<'i', int>();
program.add_argument("--temperature")
.help("Set the generation temperature")
.default_value(0.2)
.scan<'g', double>();
program.add_argument("--top-p")
.help("Set the generation top_p")
.default_value(0.1)
.scan<'g', double>();
program.add_argument("prompt").remaining();
@ -70,6 +80,8 @@ int main(int argc, char **argv)
std::mt19937 rng(program.get<int>("--random-seed"));
config.n_threads = program.get<int>("--threads");
config.temp = program.get<float>("--temperature");
config.top_p = program.get<float>("--top-p");
if(model_type.compare("codegen") == 0) {
spdlog::info("Initializing GPT-J type model for '{}' model", model_type);