Skip to content
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

Robust parsing of int and float model arguments #93

Open
kasnerz opened this issue Sep 19, 2024 · 1 comment
Open

Robust parsing of int and float model arguments #93

kasnerz opened this issue Sep 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@kasnerz
Copy link
Collaborator

kasnerz commented Sep 19, 2024

Currently, to correctly send arguments for the model API, we need to do something like this:

for arg in ["temperature", "top_p"]:
    if arg in self.config["model_args"]:
        self.config["model_args"][arg] = float(self.config["model_args"][arg])

for arg in ["max_tokens", "top_k", "seed"]:
    if arg in self.config["model_args"]:
        self.config["model_args"][arg] = int(self.config["model_args"][arg])

It would be better to try guessing the value from its format, e.g. 0.01 is probably a float, 5 is a an int, etc.

That would allow us to send even unfamiliar parameters in a correct format.

@kasnerz kasnerz added the enhancement New feature or request label Sep 19, 2024
@oplatek
Copy link
Member

oplatek commented Sep 19, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants