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

Update text_client_utils.py #2729

Merged
merged 2 commits into from Apr 21, 2023
Merged

Update text_client_utils.py #2729

merged 2 commits into from Apr 21, 2023

Conversation

mzamini92
Copy link
Contributor

This implementation adds a new get_available_models() method to the DebugClient class, which retrieves the list of available model configurations from the API and returns a list of their names. The send_message() method then calls this method and checks if the provided model_config_name is in the list of available models. If it's not, a ValueError is raised with an appropriate error message.

This implementation adds a new get_available_models() method to the DebugClient class, which retrieves the list of available model configurations from the API and returns a list of their names. The send_message() method then calls this method and checks if the provided model_config_name is in the list of available models. If it's not, a ValueError is raised with an appropriate error message.
@AbdBarho
Copy link
Collaborator

we can probably get the model names once, no need to fetch every time.

we can modify the `__init__` method to include the line `self.available_models = self.get_available_models()` so that the list of available models is retrieved only once during the instantiation of the DebugClient object:
Copy link
Contributor Author

@mzamini92 mzamini92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can modify the __init__ method to include the line self.available_models = self.get_available_models() so that the list of available models is retrieved only once during the instantiation of the DebugClient object:

@AbdBarho AbdBarho merged commit f5ef9e5 into LAION-AI:main Apr 21, 2023
1 check passed
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.

None yet

2 participants