MCPcopy Create free account
hub / github.com/CONE-MT/LLaMAX / YamlReader

Class YamlReader

scripts/inference/eval.py:17–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 print(exc)
16
17class YamlReader():
18
19 def __init__(self, yamlf):
20
21 if os.path.exists(yamlf):
22 self.yamlf = yamlf
23 else:
24 raise FileExistsError("文件不存在!")
25 self._data = None # 私有属性
26
27 @property
28 def data(self):
29 if not self._data:
30 with open(self.yamlf, 'rb') as f:
31 self._data = list(yaml.safe_load_all(f))
32 return self._data[0]
33
34class AttributeDict(dict):
35 def __init__(self, *args, **kwargs):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected