Skip to content

Commit

Permalink
Limit static synthesizer output length.
Browse files Browse the repository at this point in the history
  • Loading branch information
tymorrow committed Oct 30, 2023
1 parent 23cf42f commit 000d7eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion riid/data/synthetic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ def _report_progress(self, n_samples_expected, batch_name):
percent_complete = 100 * self._n_samples_synthesized / n_samples_expected
msg = (
f"Synthesizing ... {percent_complete:.0f}% "
f"(currently on {batch_name})"
f"(currently on {batch_name}"
)
MAX_MSG_LEN = 80
msg = (msg[:MAX_MSG_LEN] + "...") if len(msg) > MAX_MSG_LEN else msg
msg += ")"
print("\033[K" + msg, end="\r")

def _report_completion(self, delay):
Expand Down

0 comments on commit 000d7eb

Please sign in to comment.