Skip to content

refactor gpt_params_parse, add validate_params function #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

maddes8cht
Copy link

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.

add validate_params function
more consistent
handling a "-" as an arguments parameter is now handled correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant