Instructions to use xiahao90/laya-vulnerabilit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use xiahao90/laya-vulnerabilit with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download training/task.py from xiahao90/laya-vulnerabilit: direct link, hf CLI and curl.
- Browser
- Download file 800 Bytes
-
https://huggingface.co/xiahao90/laya-vulnerabilit/resolve/main/training/task.py
- Command line
-
hf download hf://xiahao90/laya-vulnerabilit/training/task.py
-
curl -L -o task.py https://huggingface.co/xiahao90/laya-vulnerabilit/resolve/main/training/task.py
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"]} | |