src/transformers/models/bertweet/tokenization_bertweet.py/_str_to_unicode
def _str_to_unicode(text, encoding=None, errors="strict"):
    if encoding is None:
        encoding = "utf-8"
    if isinstance(text, bytes):
        return text.decode(encoding, errors)
    return text