(source: str, max_n: int, split: str)
| 72 | |
| 73 | |
| 74 | def collect(source: str, max_n: int, split: str) -> list[dict]: |
| 75 | rows: list[dict] = [] |
| 76 | if source in ("hh", "both"): |
| 77 | print(f"Loading Anthropic/hh-rlhf [{split}] ...") |
| 78 | rows += from_hh(max_n, split) |
| 79 | if source in ("ultrafeedback", "both"): |
| 80 | print(f"Loading ultrafeedback_binarized [{split}] ...") |
| 81 | try: |
| 82 | rows += from_ultrafeedback(max_n, split) |
| 83 | except Exception as e: # noqa: BLE001 |
| 84 | print(f" (skipping ultrafeedback: {e})") |
| 85 | return rows |
| 86 | |
| 87 | |
| 88 | def write_jsonl(rows: list[dict], path: str) -> None: |
no test coverage detected