MCPcopy Create free account
hub / github.com/BAAI-DCAI/SpatialBot / loadFile

Function loadFile

eval/gqa/eval_gqa.py:108–122  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

106##########################################################################################
107
108def loadFile(name):
109 # load standard json file
110 if os.path.isfile(name):
111 with open(name) as file:
112 data = json.load(file)
113 # load file chunks if too big
114 elif os.path.isdir(name.split(".")[0]):
115 data = {}
116 chunks = glob.glob('{dir}/{dir}_*.{ext}'.format(dir=name.split(".")[0], ext=name.split(".")[1]))
117 for chunk in chunks:
118 with open(chunk) as file:
119 data.update(json.load(file))
120 else:
121 raise Exception("Can't find {}".format(name))
122 return data
123
124
125# Load scene graphs

Callers 1

eval_gqa.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected