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

Refinement: setting batch_size for different models #212

Merged
merged 6 commits into from
Mar 11, 2024

Conversation

riboyuan99
Copy link
Contributor

Since Google's model, OpenAI's model, and Azure OpenAI's model don't support batching locally, we will instead use num_thread to "fake batch" the data.

@riboyuan99
Copy link
Contributor Author

Will format the code shortly

Copy link

@CambioML
Copy link
Owner

CambioML commented Mar 6, 2024

@CambioML
Copy link
Owner

CambioML commented Mar 6, 2024

Could you please also check all notebook regarding whether you need to make corresponding changes as well as cookbook repo? Get @jojortz to review the cookbook repo.

@riboyuan99
Copy link
Contributor Author

Could you please also check all notebook regarding whether you need to make corresponding changes as well as cookbook repo? Get @jojortz to review the cookbook repo.

Noted

Comment on lines +203 to +206
if not batch_size:
batch_size = self._config.model_config.get(
"num_thread", 1
) # pylint: disable=no-member

Copy link
Owner

Choose a reason for hiding this comment

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

please add comment regarding why we are hacking this way, especially the logic we were talking about regarding local hosted model and proprietary models.

@@ -26,7 +26,7 @@ class GoogleModelConfig(ModelConfig):
candidate_count: int = 1
num_thread: int = 1
# this is not real batch inference, but size to group for thread pool executor.
batch_size: int = 1
# batch_size: int = 1
Copy link
Owner

Choose a reason for hiding this comment

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

you should just remove them and the same for all below. Then, check again to make sure all batch_size is removed for local hosted model.

@CambioML CambioML merged commit 2fcf828 into CambioML:main Mar 11, 2024
5 checks passed
@riboyuan99 riboyuan99 deleted the openai_client branch March 27, 2024 22:46
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.

2 participants