h2o-llmstudio icon indicating copy to clipboard operation
h2o-llmstudio copied to clipboard

add config check for learning rate typing

Open Quetzalcohuatl opened this issue 9 months ago • 3 comments

common error is to set learning rate with e notation. For example 3e-4. Yaml parses it as a string

Quetzalcohuatl avatar May 08 '24 12:05 Quetzalcohuatl

Thank you for your PR @Quetzalcohuatl After careful checks, I can assure you that the current implementation is working as intended and scientific notation is of course supported in .yaml configs.

Please make sure that you are using the yaml standard used in PyYAML and write scientific notation with a decimal point

learning_rate: 3.0e-4

or

learning_rate: 3.e-4

to be on the safe side, always write the base as a float and add a sign to the exponent (plus or minus).

pascal-pfeiffer avatar May 09 '24 07:05 pascal-pfeiffer

But your check can indeed make sense in order to catch a wrongfully formatted learning rate. In that case, please update the error message to reflect the correct usage.

pascal-pfeiffer avatar May 09 '24 07:05 pascal-pfeiffer

But your check can indeed make sense in order to catch a wrongfully formatted learning rate. In that case, please update the error message to reflect the correct usage.

Yep, realized that after I made the post haha. Perhaps a config validator is an idea. There was another hyperparam (can't remember which one) where I passed 1.0 and it complained because it was a float and wanted an integer 1.

Quetzalcohuatl avatar May 09 '24 11:05 Quetzalcohuatl

@pascal-pfeiffer Imo if you have the code for type-checking for UI, might as well lift-and-shift it to the CLI use-case. That would solve the error where for one of the hyperparams I typed "1.0" as a float but it wanted an integer as "1"

Quetzalcohuatl avatar May 18 '24 13:05 Quetzalcohuatl

Yes, that would be great. Though, in current form, the code will never get called. The integration to CLI needs to be added

pascal-pfeiffer avatar May 18 '24 15:05 pascal-pfeiffer

closing this for now, please re-open accordingly

psinger avatar Jul 23 '24 12:07 psinger