from typing import Union
from pathlib import Path
from typing import Any
import json


def load_jsonl(path: Union[Path, str]) -> list[dict[str, Any]]:
  """ Load from jsonl.

  Args:
    path: path to the jsonl file

  """
  path = Path(path)
  return [json.loads(line) for line in path.read_text().splitlines()]