Repository navigation
[Gemini] Prototype OpenAI RemoteInferenceModelHandler Implementation - #40239
Conversation
|
Assigning reviewers: R: @claudevdm for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
| A list of Embedding objects matching the batch order. | ||
| """ | ||
| inf_args = dict(inference_args) | ||
| response = client.embeddings.create( |
There was a problem hiding this comment.
Should we set a default max batch size so that we dont exceed the api batch size limits?
|
Test failures are still the Bigtable issues |
|
|
||
|
|
||
| def _run_async_with_client(client: AsyncOpenAI, coro: Any) -> Any: | ||
| """Runs a coroutine via asyncio.run and cleans up idle pool connections.""" |
There was a problem hiding this comment.
I believe RunInference shares the client between harness threads so once a batch is done this helper closes all of the client's connections that other threads are waiting on?
Maybe we should we go back to the regular OpenAI client and use a small thread pool to send the prompts at the same time? Or, if you'd rather stay async, create the client inside each batch like the vLLM handler does?
There was a problem hiding this comment.
flipped back to sync client
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40239 +/- ##
============================================
- Coverage 56.09% 55.15% -0.94%
+ Complexity 2284 1722 -562
============================================
Files 1120 1079 -41
Lines 176909 173143 -3766
Branches 1475 1262 -213
============================================
- Hits 99244 95505 -3739
- Misses 75147 75362 +215
+ Partials 2518 2276 -242
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@claudevdm bump |
Experimental codegen implementation of an OpenAI RemoteInferenceModelHandler in the Python SDK. As is the case with the Java implementation, the IT test will not run as part of CI because beam does not have an OpenAI API key secret.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.