{"record":{"id":"6fbd7e001f0d6c5c","repo":"tensorflow/models","slug":"unsupported-label-type-given-s-expected-int","errorCode":null,"errorMessage":"Unsupported `label_type`. Given: %s, expected `int` or `float`.","messagePattern":"Unsupported `label_type`\\. Given: (.+?), expected `int` or `float`\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/finetuning/binary_helper.py","lineNumber":277,"sourceCode":"\n  Args:\n    task: `Task` instance.\n    model: `keras.Model` instance.\n    input_file: Input test data file path.\n    output_file: Output test data file path.\n    predict_batch_size: Batch size for prediction.\n    seq_length: Input sequence length.\n    class_names: List of string class names.\n    label_type: String denoting label type ('int', 'float'), defaults to 'int'.\n    min_float_value: If set, predictions will be min-clipped to this value (only\n      for regression when `label_type` is set to 'float'). Defaults to `None`\n      (no clipping).\n    max_float_value: If set, predictions will be max-clipped to this value (only\n      for regression when `label_type` is set to 'float'). Defaults to `None`\n      (no clipping).\n  \"\"\"\n  if label_type not in ('int', 'float'):\n    raise ValueError('Unsupported `label_type`. Given: %s, expected `int` or '\n                     '`float`.' % label_type)\n\n  data_config = sentence_prediction_dataloader.SentencePredictionDataConfig(\n      input_path=input_file,\n      global_batch_size=predict_batch_size,\n      is_training=False,\n      seq_length=seq_length,\n      label_type=label_type,\n      drop_remainder=False,\n      include_example_id=True)\n  predictions = sentence_prediction.predict(task, data_config, model)\n\n  if label_type == 'float':\n    min_float_value = (-sys.float_info.max\n                       if min_float_value is None else min_float_value)\n    max_float_value = (\n        sys.float_info.max if max_float_value is None else max_float_value)\n","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/finetuning/binary_helper.py#L259-L295","documentation":"Error \"Unsupported `label_type`. Given: %s, expected `int` or `float`.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/finetuning/binary_helper.py:277 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"}