def _hyperparams_text_to_dict(cfg_text):
  """Converts hyperparams config text to a dictionary of key-value pairs."""
  txt_list = cfg_text.split("\n")
  pair_list = []
  for v in txt_list:
    if not v:
      continue
    vals = v.split(" : ")
    if len(vals) != 2:
      raise ValueError(v)
    pair_list.append(vals)
  return dict(pair_list)