[docs]@classmethoddefload(cls,f):# Assumes everything is encoded in UTF-8.# This means that if some records (e.g., config files, feature vector# keys) are not encoded in UTF-8, the model cannot be loaded. However,# such models cannot be written out to text or JSON, so we don't really# care. Callers are responsible for handling UnicodeDecodeError.values=msgpack.load(f,encoding='utf-8',unicode_errors='strict')field_names=map(lambdax:x[0],cls.fields())c=cls()c.set(dict(zip(field_names,values)))returnc