Text Generation
PEFT
TensorBoard
Safetensors
code
English
security
cybersecurity
secure-coding
ai-security
owasp
code-generation
lora
fine-tuned
securecode
conversational
Run this model with HF Jobs
Run scthornton/codellama-13b-securecode 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/scthornton/codellama-13b-securecode. 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/scthornton/codellama-13b-securecode 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.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/scthornton/codellama-13b-securecode. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/scthornton/codellama-13b-securecode. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use scthornton/codellama-13b-securecode with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use scthornton/codellama-13b-securecode with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("codellama/CodeLlama-13b-Instruct-hf") model = PeftModel.from_pretrained(base_model, "scthornton/codellama-13b-securecode") - Notebooks
- Google Colab
- Kaggle
Model save
Browse filesFiles changed (6)
- README.mdAdded+62
- chat_template.jinjaAdded+1
- special_tokens_map.jsonAdded+30
- tokenizer.jsonAdded
- tokenizer.modelAdded+3
- tokenizer_config.jsonAdded+84
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162---library_name: peftlicense: llama2base_model: codellama/CodeLlama-13b-Instruct-hftags:- base_model:adapter:codellama/CodeLlama-13b-Instruct-hf- lora- transformersdatasets:- securecode-v2pipeline_tag: text-generationmodel-index:- name: codellama-13b-securecode results: []---
<!-- This model card has been generated automatically according to the information the Trainer had access to. Youshould probably proofread and complete it, then remove this comment. -->
# codellama-13b-securecode
This model is a fine-tuned version of [codellama/CodeLlama-13b-Instruct-hf](https://huggingface.co/codellama/CodeLlama-13b-Instruct-hf) on the securecode-v2 dataset.
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:- learning_rate: 0.0002- train_batch_size: 2- eval_batch_size: 8- seed: 42- gradient_accumulation_steps: 8- total_train_batch_size: 16- optimizer: Use paged_adamw_8bit with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments- lr_scheduler_type: cosine- lr_scheduler_warmup_steps: 100- num_epochs: 3
### Training results
### Framework versions
- PEFT 0.18.1- Transformers 4.57.6- Pytorch 2.7.1+cu128- Datasets 2.16.0- Tokenizers 0.22.21{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<<SYS>>\n' + system_message + '\n<</SYS>>\n\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + '[INST] ' + content | trim + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content | trim + ' ' + eos_token }}{% endif %}{% endfor %}123456789101112131415161718192021222324252627282930{ "additional_special_tokens": [ "β<PRE>", "β<MID>", "β<SUF>", "β<EOT>" ], "bos_token": { "content": "<s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "eos_token": { "content": "</s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "pad_token": "</s>", "unk_token": { "content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}123version https://git-lfs.github.com/spec/v1oid sha256:45ccb9c8b6b561889acea59191d66986d314e7cbd6a78abc6e49b139ca91c1e6size 500058123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384{ "add_bos_token": true, "add_eos_token": false, "added_tokens_decoder": { "0": { "content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "<s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "</s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32007": { "content": "β<PRE>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32008": { "content": "β<SUF>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32009": { "content": "β<MID>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32010": { "content": "β<EOT>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "additional_special_tokens": [ "β<PRE>", "β<MID>", "β<SUF>", "β<EOT>" ], "bos_token": "<s>", "clean_up_tokenization_spaces": false, "eos_token": "</s>", "eot_token": "β<EOT>", "extra_special_tokens": {}, "fill_token": "<FILL_ME>", "legacy": null, "middle_token": "β<MID>", "model_max_length": 1000000000000000019884624838656, "pad_token": "</s>", "prefix_token": "β<PRE>", "sp_model_kwargs": {}, "suffix_token": "β<SUF>", "tokenizer_class": "CodeLlamaTokenizer", "unk_token": "<unk>", "use_default_system_prompt": false}README.mdAdded+62
chat_template.jinjaAdded+1
special_tokens_map.jsonAdded+30
tokenizer.jsonAdded
tokenizer.modelAdded+3
tokenizer_config.jsonAdded+84