(fname: str, split: bool)
| 619 | |
| 620 | |
| 621 | def get_outfnames(fname: str, split: bool) -> list[str]: |
| 622 | suffixes = ["_train", "_valid"] if split else [""] |
| 623 | i = 0 |
| 624 | while True: |
| 625 | index_suffix = f" ({i})" if i > 0 else "" |
| 626 | candidate_fnames = [f"{os.path.splitext(fname)[0]}_prepared{suffix}{index_suffix}.jsonl" for suffix in suffixes] |
| 627 | if not any(os.path.isfile(f) for f in candidate_fnames): |
| 628 | return candidate_fnames |
| 629 | i += 1 |
| 630 | |
| 631 | |
| 632 | def get_classification_hyperparams(df: pd.DataFrame) -> tuple[int, object]: |