Serializes this instance to a JSON string. Args: use_diff (:obj:`bool`): If set to True, only the difference between the config instance and the default PretrainedConfig() is serialized to JSON string. Returns: :obj:`string`: String
(self, use_diff=True)
| 367 | return output |
| 368 | |
| 369 | def to_json_string(self, use_diff=True): |
| 370 | """ |
| 371 | Serializes this instance to a JSON string. |
| 372 | |
| 373 | Args: |
| 374 | use_diff (:obj:`bool`): |
| 375 | If set to True, only the difference between the config instance and the default PretrainedConfig() is serialized to JSON string. |
| 376 | |
| 377 | Returns: |
| 378 | :obj:`string`: String containing all the attributes that make up this configuration instance in JSON format. |
| 379 | """ |
| 380 | if use_diff is True: |
| 381 | config_dict = self.to_diff_dict() |
| 382 | else: |
| 383 | config_dict = self.to_dict() |
| 384 | return json.dumps(config_dict, indent=2, sort_keys=True) + "\n" |
| 385 | |
| 386 | def to_json_file(self, json_file_path, use_diff=True): |
| 387 | """ |
no test coverage detected