Run this model with HF Jobs

Run xiahao90/laya-vulnerabilit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/xiahao90/laya-vulnerabilit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/xiahao90/laya-vulnerabilit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
xiahao90's picture
发布 Laya 漏洞检测实验模型、Apache-2.0 许可及复现记录
c4cdb6d verified
Raw History Blame Contribute Delete
800 Bytes
"""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"]}