ggllm.cpp icon indicating copy to clipboard operation
ggllm.cpp copied to clipboard

refactor gpt_params_parse, add validate_params function

Open maddes8cht opened this issue 2 years ago • 0 comments

The parsing of the parameters is broken. Basically, parameters were only parsed correctly to arguments if it was the last argument of the command line. For most parameter errors in the middle of the command line, the program terminates without any error message.

A separate validate_params function fixes these problems. Originally there was the thought to provide the validate function with checks for numeric or string values, but after switching the function to error handling with try/catch it turns out that the std::stoi, std::stof functions then provide these messages for free.

Since the help text is very long, it is not very helpful to display the entire help text for each error - on the contrary, this hides the actual error message, because you have to scroll back page by page to be able to read it. In case of an error, an error message is now displayed that is much more meaningful than before, as well as a reference to the help.

maddes8cht avatar Jul 23 '23 15:07 maddes8cht