{"record":{"id":"e88c1411f0fffd40","repo":"tensorflow/models","slug":"only-round-robin-and-waterfall-algorithms-are","errorCode":null,"errorMessage":"Only 'round_robin' and 'waterfall' algorithms are supported, but got %s","messagePattern":"Only 'round_robin' and 'waterfall' algorithms are supported, but got (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/modeling/layers/text_layers.py","lineNumber":490,"sourceCode":"          (1) For \"round_robin\" algorithm, available space is assigned\n          one token at a time in a round-robin fashion to the inputs that still\n          need some, until the limit is reached. It currently only supports\n          one or two segments.\n          (2) For \"waterfall\" algorithm, the allocation of the budget is done\n            using a \"waterfall\" algorithm that allocates quota in a\n            left-to-right manner and fills up the buckets until we run out of\n            budget. It support arbitrary number of segments.\n\n      **kwargs: standard arguments to `Layer()`.\n\n    Raises:\n      ImportError: if importing `tensorflow_text` failed.\n    \"\"\"\n    _check_if_tf_text_installed()\n    super().__init__(**kwargs)\n    self.seq_length = seq_length\n    if truncator not in (\"round_robin\", \"waterfall\"):\n      raise ValueError(\"Only 'round_robin' and 'waterfall' algorithms are \"\n                       \"supported, but got %s\" % truncator)\n    self.truncator = truncator\n    self._init_token_ids(\n        start_of_sequence_id=start_of_sequence_id,\n        end_of_segment_id=end_of_segment_id,\n        padding_id=padding_id,\n        special_tokens_dict=special_tokens_dict)\n\n  def _init_token_ids(\n      self, *,\n      start_of_sequence_id,\n      end_of_segment_id,\n      padding_id,\n      special_tokens_dict):\n    usage = (\"Must pass either all of start_of_sequence_id, end_of_segment_id, \"\n             \"padding_id as arguments, or else a special_tokens_dict \"\n             \"with those keys.\")\n    special_tokens_args = [start_of_sequence_id, end_of_segment_id, padding_id]","sourceCodeStart":472,"sourceCodeEnd":508,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/modeling/layers/text_layers.py#L472-L508","documentation":"Error \"Only 'round_robin' and 'waterfall' algorithms are supported, but got %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/modeling/layers/text_layers.py:490 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"}