Pause the rich live display while datasets materialize so hub tqdm progress (download/generating splits) is visible instead of being erased; reporter gains pause()/resume()
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c728db5f35
commit
8ea83fea4f
@ -478,7 +478,11 @@ def _cmd_eval_run(args) -> int:
|
||||
_print_phase(console, i + 1, total_runs, name,
|
||||
'loading/downloading dataset')
|
||||
ds = get_dataset(name, **overrides)
|
||||
if _shared_reporter is not None:
|
||||
_shared_reporter.pause() # let hub tqdm print cleanly
|
||||
sample_count = len(ds)
|
||||
if _shared_reporter is not None:
|
||||
_shared_reporter.resume()
|
||||
origin = ds.lineage.get('from', 'unknown')
|
||||
_print_phase(console, i + 1, total_runs, name,
|
||||
f'dataset ready · samples={sample_count} · source={origin}')
|
||||
|
||||
@ -151,6 +151,16 @@ class RichTerminalProgress:
|
||||
else:
|
||||
self.console.print(message)
|
||||
|
||||
def pause(self):
|
||||
"""Temporarily stop the live display (e.g. while hub downloads print
|
||||
their own tqdm); task state is kept and resume() restores the bars."""
|
||||
if self.task_id is not None or self.overall_id is not None:
|
||||
self.progress.stop()
|
||||
|
||||
def resume(self):
|
||||
if self.task_id is not None or self.overall_id is not None:
|
||||
self.progress.start()
|
||||
|
||||
def close(self):
|
||||
if self.task_id is not None:
|
||||
if self.heartbeat_task is not None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user