Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation for model_name parameter (#476)
This PR introduces a validation check for the `model_name` parameter within the `openai` method of the `outlines.models` module. The aim is to ensure that only valid model names are used when calling this function. As per the current implementation, any string passed as the `model_name` would be accepted. The change enforces the function to only accept `gpt-4` or `gpt-3.5-turbo` as valid model names. If any other model name is passed, a ValueError is raised, informing the user about the invalid input and suggesting the correct model names. This change also adds tests to `tests/models/test_openai.py`. To ensure an invalid model raises a value error. Note: I added `gpt-4-1106-preview` in the tests, so when or if it's added to the suite of models supported by outlines, that will need to be updated, along with the mode in `openai.py` Co-authored-by: Stephen Witkowski <[email protected]>
- Loading branch information