File size: 800 Bytes
c4cdb6d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""The fixed task schema shared by training, evaluation, and serving."""
QUESTION = {
    "type": "choice",
    "instructions": "Determine whether the supplied source code contains a security vulnerability. Judge the executable code and its data flow, not naming conventions.",
    "criteria": {
        "safe": "No security vulnerability is demonstrated within the supplied code and context.",
        "vulnerable": "The supplied code and context demonstrate a security vulnerability.",
    },
}
INTERNAL_QUESTION = {"t": QUESTION["type"], "ins": QUESTION["instructions"], "crit": QUESTION["criteria"]}


def state_for(record):
    # Metadata, filenames, CWE labels, CVE descriptions and commit messages are deliberately excluded.
    return {"language": record["language"], "code": record["code"]}