Skip to content

Commit

Permalink
EXPERIMENTAL: async entrypoints for experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
anticorrelator committed Sep 26, 2024
1 parent 213193a commit 238001e
Show file tree
Hide file tree
Showing 3 changed files with 446 additions and 31 deletions.
11 changes: 11 additions & 0 deletions packages/phoenix-evals/src/phoenix/evals/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,18 @@ def get_executor_on_sync_context(
max_retries: int = 10,
exit_on_error: bool = True,
fallback_return_value: Union[Unset, Any] = _unset,
use_async: bool = False,
) -> Executor:
if use_async is True:
return AsyncExecutor(
async_fn,
concurrency=concurrency,
tqdm_bar_format=tqdm_bar_format,
max_retries=max_retries,
exit_on_error=exit_on_error,
fallback_return_value=fallback_return_value,
)

if threading.current_thread() is not threading.main_thread():
# run evals synchronously if not in the main thread

Expand Down
Loading

0 comments on commit 238001e

Please sign in to comment.