def from_json_file(cls: Type[ConfigT], json_file: Text) -> ConfigT:
    """Constructs a `BertConfig` from a json file of parameters."""
    if not issubclass(cls, Config):
      raise ValueError(
          f"Expected `cls` to be a `Config` class but found '{cls.__name__}'")

    with tf.gfile.GFile(json_file, "r") as f:
      return cls.from_dict(json.load(f), debug_filename=json_file)
Constructs a `BertConfig` from a json file of parameters.
language/canine/config_utils.py