Skip to content

Commit

Permalink
one line
Browse files Browse the repository at this point in the history
  • Loading branch information
mgordon-arize committed Oct 18, 2024
1 parent f3c5b1a commit 685dd42
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/phoenix-evals/src/phoenix/evals/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@ def termination_handler(signum: int, frame: Any) -> None:
original_handler = signal.signal(self.termination_signal, termination_handler)
outputs = [self.fallback_return_value] * len(inputs)
execution_details = [ExecutionDetails() for _ in range(len(inputs))]
if self.tqdm_bar_format is None:
progress_bar = tqdm(total=len(inputs), bar_format=self.tqdm_bar_format, disable=True)
else:
progress_bar = tqdm(total=len(inputs), bar_format=self.tqdm_bar_format)
progress_bar = tqdm(
total=len(inputs),
bar_format=self.tqdm_bar_format,
disable=self.tqdm_bar_format is None,
)

max_queue_size = 5 * self.concurrency # limit the queue to bound memory usage
max_fill = max_queue_size - (2 * self.concurrency) # ensure there is always room to requeue
Expand Down Expand Up @@ -342,10 +343,11 @@ def run(self, inputs: Sequence[Any]) -> Tuple[List[Any], List[Any]]:
execution_details: List[ExecutionDetails] = [
ExecutionDetails() for _ in range(len(inputs))
]
if self.tqdm_bar_format is None:
progress_bar = tqdm(total=len(inputs), bar_format=self.tqdm_bar_format, disable=True)
else:
progress_bar = tqdm(total=len(inputs), bar_format=self.tqdm_bar_format)
progress_bar = tqdm(
total=len(inputs),
bar_format=self.tqdm_bar_format,
disable=self.tqdm_bar_format is None,
)

for index, input in enumerate(inputs):
task_start_time = time.time()
Expand Down

0 comments on commit 685dd42

Please sign in to comment.