(self, ids)
return "".join(retarr)
Returns a text that encoded would yield provided ids.
Returns a text that encoded would yield provided ids.
Returns a text that encoded would yield provided ids .
def decode(self, ids):
    """Returns a text that encoded would yield provided ids."""
    tokens = self._convert_ids_to_tokens(ids)
    if not tokens:
      return ""
    retarr = [tokens[0]]
    for token in tokens[1:]:
      if token.startswith("##"):
        retarr.append(token.lstrip("#"))
      else:
        retarr.append(" ")
        retarr.append(token)
    return "".join(retarr)
def decode ( self , ids ) : tokens = self . _convert_ids_to_tokens ( ids ) if not tokens : return "" retarr = [ tokens [ 0 ] ] for token in tokens [ 1 : ] : if token . startswith ( "##" ) : retarr . append ( token . lstrip ( "#" ) ) else : retarr . append ( " " ) retarr . append ( token ) return "" . join ( retarr )