(file: Union[str, Path])
| 18 | |
| 19 | |
| 20 | def load_jsonl(file: Union[str, Path]) -> Iterable[Any]: |
| 21 | with open(file, "r", encoding="utf-8") as f: |
| 22 | for line in f: |
| 23 | try: |
| 24 | yield json.loads(line) |
| 25 | except: |
| 26 | print("Error in loading:", line) |
| 27 | exit() |
| 28 | |
| 29 | |
| 30 | def save_jsonl(samples, save_path): |
no outgoing calls
no test coverage detected