{"record":{"id":"678e519e53a0b6f3","repo":"babysor/MockingBird","slug":"unknown-cleaner-s","errorCode":null,"errorMessage":"Unknown cleaner: %s","messagePattern":"Unknown cleaner: (.+?)","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"models/synthesizer/utils/text.py","lineNumber":60,"sourceCode":"\ndef sequence_to_text(sequence):\n  \"\"\"Converts a sequence of IDs back to a string\"\"\"\n  result = \"\"\n  for symbol_id in sequence:\n    if symbol_id in _id_to_symbol:\n      s = _id_to_symbol[symbol_id]\n      # Enclose ARPAbet back in curly braces:\n      if len(s) > 1 and s[0] == \"@\":\n        s = \"{%s}\" % s[1:]\n      result += s\n  return result.replace(\"}{\", \" \")\n\n\ndef _clean_text(text, cleaner_names):\n  for name in cleaner_names:\n    cleaner = getattr(cleaners, name)\n    if not cleaner:\n      raise Exception(\"Unknown cleaner: %s\" % name)\n    text = cleaner(text)\n  return text\n\n\ndef _symbols_to_sequence(symbols):\n  return [_symbol_to_id[s] for s in symbols if _should_keep_symbol(s)]\n\n\ndef _arpabet_to_sequence(text):\n  return _symbols_to_sequence([\"@\" + s for s in text.split()])\n\n\ndef _should_keep_symbol(s):\n  return s in _symbol_to_id and s not in (\"_\", \"~\")\n","sourceCodeStart":42,"sourceCodeEnd":75,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/models/synthesizer/utils/text.py#L42-L75","documentation":"_clean_text looks up each requested cleaner by name via getattr(cleaners, name). If the module has no such attribute, getattr returns the module's default (None here since nothing matched) and the code raises 'Unknown cleaner'. Note: getattr without a default raises AttributeError; None occurs only when the attribute exists but is None.","triggerScenarios":"Calling text_to_sequence(text, cleaner_names) with a cleaner name not defined in models/synthesizer/utils/cleaners.py, e.g. 'english_cleaners2' (used by newer Tacotron/Mozilla Twitch versions) while this repo only has 'english_cleaners'.","commonSituations":"Porting configs from Mozilla TTS / Tacotron2 repos whose cleaner names differ; typo in cleaner name; missing symbols file variant (basic/symbols difference).","solutions":["Open models/synthesizer/utils/cleaners.py and use an existing cleaner name (typically 'english_cleaners')","Add the missing cleaner function to cleaners.py if porting from another repo","Check spelling/case of the cleaner name in hparams"],"exampleFix":"# before\ntext_to_sequence(t, ['english_cleaners2'])  # Unknown cleaner\n\n# after\ntext_to_sequence(t, ['english_cleaners'])","handlingStrategy":"validation","validationCode":"from models.synthesizer.utils import cleaners, text\ncleaner_names = ['english_cleaners']\nfor c in cleaner_names:\n    assert callable(getattr(cleaners, c, None)), f'unknown cleaner {c}'","typeGuard":"def valid_cleaner(name: str) -> bool:\n    from models.synthesizer.utils import cleaners\n    return callable(getattr(cleaners, name, None))","tryCatchPattern":null,"preventionTips":["Use cleaner names defined in this repo's cleaners.py, not upstream Mozilla TTS names","Centralize the cleaner list in hparams instead of per-call literals"],"tags":["text-processing","cleaners","tts","config"],"backgroundTag":"missing-function-attribute","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}