MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / dict2hg

Function dict2hg

examples/grpo_toolcall/get_toolace_data.py:236–252  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

234
235
236def dict2hg(data):
237 hg_data = {"tools": [], "conversations": [], "answer": [], "raw_system": []}
238 for item in data:
239 tool = json.dumps(item["tools"])
240 hg_data["tools"].append(tool)
241 hg_data["conversations"].append(item["conversations"])
242 answer = json.dumps(item["answer"])
243 hg_data["answer"].append(answer)
244 hg_data["raw_system"].append(item["raw_system"])
245 hg_data = {
246 "tools": hg_data["tools"][:],
247 "conversations": hg_data["conversations"][:],
248 "answer": hg_data["answer"][:],
249 "raw_system": hg_data["raw_system"][:],
250 }
251 hg_data = Dataset.from_dict(hg_data)
252 return hg_data
253
254
255def create_dataset_files(output_dir):

Callers 1

create_dataset_filesFunction · 0.85

Calls 1

from_dictMethod · 0.80

Tested by

no test coverage detected