{"record":{"id":"5da1fb7f810e0e61","repo":"tensorflow/models","slug":"unexpected-that-both-s-and-s-are-in-config","errorCode":null,"errorMessage":"Unexpected that both %s and %s are in config.","messagePattern":"Unexpected that both (.+?) and (.+?) are in config\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/finetuning/binary_helper.py","lineNumber":103,"sourceCode":"    return {}\n\n  try:\n    encoder_config = encoders.EncoderConfig()\n    encoder_config = hyperparams.override_params_dict(\n        encoder_config, model_config_file, is_strict=True)\n    logging.info('Load encoder_config yaml file from %s.', model_config_file)\n    return encoder_config.as_dict()\n  except KeyError:\n    pass\n\n  logging.info('Load bert config json file from %s', model_config_file)\n  with tf.io.gfile.GFile(model_config_file, 'r') as reader:\n    text = reader.read()\n    config = json.loads(text)\n\n  def get_value(key1, key2):\n    if key1 in config and key2 in config:\n      raise ValueError('Unexpected that both %s and %s are in config.' %\n                       (key1, key2))\n\n    return config[key1] if key1 in config else config[key2]\n\n  def get_value_or_none(key):\n    return config[key] if key in config else None\n\n  # Support both legacy bert_config attributes and the new config attributes.\n  return {\n      'bert': {\n          'attention_dropout_rate':\n              get_value('attention_dropout_rate',\n                        'attention_probs_dropout_prob'),\n          'dropout_rate':\n              get_value('dropout_rate', 'hidden_dropout_prob'),\n          'hidden_activation':\n              get_value('hidden_activation', 'hidden_act'),\n          'hidden_size':","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/finetuning/binary_helper.py#L85-L121","documentation":"Error \"Unexpected that both %s and %s are in config.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/finetuning/binary_helper.py:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}