MCPcopy
hub / github.com/PaddlePaddle/PaddleFormers / _get_last_n_lines

Function _get_last_n_lines

scripts/ci_utils/training_utils.py:141–146  ·  view source on GitHub ↗

Get the last n lines of text.

(text, n=100)

Source from the content-addressed store, hash-verified

139
140
141def _get_last_n_lines(text, n=100):
142 """Get the last n lines of text."""
143 lines = text.strip().split("\n")
144 if len(lines) <= n:
145 return text
146 return f"... (truncated, showing last {n} lines) ...\n" + "\n".join(lines[-n:])
147
148
149def run_command_and_validate(cmd, baseline_path, log_file, working_dir=None, tolerance=1e-6, timeout=3600):

Callers 2

validate_lossesMethod · 0.85
run_command_and_validateFunction · 0.85

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected