minicpm5-toolcall-code / inspect_raw.py
DevGwardo's picture
Training + eval pipeline
c4a370a verified
Raw History Blame Contribute Delete
897 Bytes
import json, sys, collections
data = json.load(open(sys.argv[1], encoding="utf-8"))
d = data[0]
print("=== SYSTEM (first 1200) ===")
print(d["system"][:1200])
print("\n=== CONVERSATIONS ===")
for m in d["conversations"]:
print(m["from"], "::", m["value"][:700].replace("\n", "\\n"))
# marker survey
markers = collections.Counter()
for row in data:
for m in row["conversations"]:
v = m["value"]
for tag in ("<functioncall>", "<toolcall>", "<|tool_call|>", "<function_call>", "```json"):
if tag in v:
markers[(m["from"], tag)] += 1
print("\nmarkers:", markers.most_common(10))
# an assistant turn that looks like a call
for row in data:
for m in row["conversations"]:
if m["from"] == "assistant" and "{" in m["value"]:
print("\n=== ASSISTANT SAMPLE ===")
print(m["value"][:900])
raise SystemExit