Skip to content

Commit

Permalink
lf.llms.VertexAI to use _parallel_execute_with_currency_control.
Browse files Browse the repository at this point in the history
This automatically pass through timeout and max worker settings.

PiperOrigin-RevId: 677914229
  • Loading branch information
daiyip authored and langfun authors committed Sep 23, 2024
1 parent 9ee327e commit 1338397
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions langfun/core/llms/vertexai.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,9 @@ def _sample(self, prompts: list[lf.Message]) -> list[lf.LMSamplingResult]:
(Exception, 'ValueError: Cannot get the Candidate text.'),
]

return lf.concurrent_execute(
return self._parallel_execute_with_currency_control(
self._sample_single,
prompts,
executor=self.resource_id,
max_workers=self.max_concurrency,
retry_on_errors=retry_on_errors,
)

Expand Down

0 comments on commit 1338397

Please sign in to comment.