MCPcopy Create free account
hub / github.com/THUDM/GLM / read_input_to_queue

Method read_input_to_queue

data_utils/corpora.py:129–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127 processes.append(process)
128
129 def read_input_to_queue():
130 for path in paths:
131 print_rank_0(f"Start reading {path}")
132 with open(path) as file:
133 if self.split_row:
134 for row in file:
135 task_queue.put(row)
136 else:
137 items = json.load(file)
138 for item in items["RECORDS"]:
139 task_queue.put(item)
140 print_rank_0("Read input complete")
141 for i in range(len(processes)):
142 task_queue.put('STOP')
143
144 process = Process(target=read_input_to_queue)
145 process.start()

Callers

nothing calls this directly

Calls 2

print_rank_0Function · 0.90
loadMethod · 0.80

Tested by

no test coverage detected