File size: 897 Bytes
c4a370a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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