MCPcopy Create free account
hub / github.com/baidu/DDParser / __setstate__

Method __setstate__

ddparser/parser/data_struct/vocab.py:67–72  ·  view source on GitHub ↗

setstate

(self, state)

Source from the content-addressed store, hash-verified

65 return attrs
66
67 def __setstate__(self, state):
68 """setstate"""
69 stoi = defaultdict(lambda: self.unk_index)
70 stoi.update(state['stoi'])
71 state['stoi'] = stoi
72 self.__dict__.update(state)
73
74 def extend(self, tokens):
75 """Update tokens to itos and stoi"""

Callers

nothing calls this directly

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected