Instructions to use Abel252/BriskFO_Coderv1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Abel252/BriskFO_Coderv1 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-1.3b-instruct") model = PeftModel.from_pretrained(base_model, "Abel252/BriskFO_Coderv1") - Notebooks
- Google Colab
- Kaggle
Upload PEFT/LoRA adapter (300 steps fine-tuned)
Browse filesFiles changed (7)
- README.md+110-3
- adapter_config.jsonAdded+42
- adapter_model.safetensorsAdded+3
- chat_template.jinjaAdded+26
- special_tokens_map.jsonAdded+23
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+194
123---license: apache-2.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110---language:- enlicense: apache-2.0tags:- pytorch- peft- lora- code-generation- deepseek-coder- fine-tuneddatasets:- custom-code-datasetmodel-index:- name: BriskFO_Coderv1results: []---# BriskFO_Coderv1## Model DescriptionThis is a **PEFT/LoRA adapter** fine-tuned on DeepSeek Coder 1.3B Instruct model. It was trained for 300 steps on a custom code generation dataset.## Model TypeThis is a **PEFT (Parameter-Efficient Fine-Tuning)** model, specifically using **LoRA (Low-Rank Adaptation)**. It contains only the adapter weights, not the full model.## Training Details- **Base Model**: `deepseek-ai/deepseek-coder-1.3b-instruct`- **Training Steps**: 300- **Learning Rate**: 2e-4- **Batch Size**: 16- **Gradient Accumulation**: 4- **Sequence Length**: 34958- **Training Method**: PEFT/LoRA## FilesThis repository contains:- `adapter_model.bin` / `adapter_model.safetensors` - LoRA adapter weights- `adapter_config.json` - PEFT configuration- `tokenizer.json`, `tokenizer_config.json` - Tokenizer files- `special_tokens_map.json` - Special tokens mapping## Usage### Installation```bashpip install transformers peft accelerate torch```### Loading the Model```pythonfrom transformers import AutoTokenizer, AutoModelForCausalLMfrom peft import PeftModel, PeftConfig# Load the base modelbase_model_id = "deepseek-ai/deepseek-coder-1.3b-instruct"adapter_model_id = "abel252/BriskFO_Coderv1"# Load tokenizertokenizer = AutoTokenizer.from_pretrained(adapter_model_id)# Load base modelbase_model = AutoModelForCausalLM.from_pretrained(base_model_id,torch_dtype="auto",device_map="auto")# Load PEFT adaptermodel = PeftModel.from_pretrained(base_model, adapter_model_id)# For inference, you can merge the adapter with the base model (optional)# model = model.merge_and_unload()```### Inference Example```python# Prepare inputprompt = "Write a Python function to calculate fibonacci numbers"inputs = tokenizer(prompt, return_tensors="pt").to(model.device)# Generateoutputs = model.generate(**inputs,max_new_tokens=256,temperature=0.7,top_p=0.95,do_sample=True)# Decoderesponse = tokenizer.decode(outputs[0], skip_special_tokens=True)print(response)```## LicenseThis model is released under the Apache 2.0 license.## Acknowledgments- Base model: [DeepSeek Coder](https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-instruct)- Fine-tuning framework: [PEFT](https://github.com/huggingface/peft)
123456789101112131415161718192021222324252627282930313233343536373839404142{ "alpha_pattern": {}, "auto_mapping": null, "base_model_name_or_path": "deepseek-ai/deepseek-coder-1.3b-instruct", "bias": "none", "corda_config": null, "eva_config": null, "exclude_modules": null, "fan_in_fan_out": false, "inference_mode": true, "init_lora_weights": true, "layer_replication": null, "layers_pattern": null, "layers_to_transform": null, "loftq_config": {}, "lora_alpha": 32, "lora_bias": false, "lora_dropout": 0.05, "megatron_config": null, "megatron_core": "megatron.core", "modules_to_save": null, "peft_type": "LORA", "qalora_group_size": 16, "r": 16, "rank_pattern": {}, "revision": null, "target_modules": [ "q_proj", "gate_proj", "up_proj", "o_proj", "k_proj", "v_proj", "down_proj" ], "target_parameters": null, "task_type": "CAUSAL_LM", "trainable_token_indices": null, "use_dora": false, "use_qalora": false, "use_rslora": false}123version https://git-lfs.github.com/spec/v1oid sha256:57caf239eeaf690f9b9db3da1922ca95bd89097a0e2f9c40182557e2ed7cdb4dsize 600100481234567891011121314151617181920212223242526{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{%- set ns = namespace(found=false) -%}{%- for message in messages -%} {%- if message['role'] == 'system' -%} {%- set ns.found = true -%} {%- endif -%}{%- endfor -%}{{bos_token}}{%- if not ns.found -%}{{'You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer\n'}}{%- endif %}{%- for message in messages %} {%- if message['role'] == 'system' %}{{ message['content'] }} {%- else %} {%- if message['role'] == 'user' %}{{'### Instruction:\n' + message['content'] + '\n'}} {%- else %}{{'### Response:\n' + message['content'] + '\n<|EOT|>\n'}} {%- endif %} {%- endif %}{%- endfor %}{% if add_generation_prompt %}{{'### Response:'}}{% endif %}1234567891011121314151617181920212223{ "bos_token": { "content": "<|begin▁of▁sentence|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|EOT|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "pad_token": { "content": "<|end▁of▁sentence|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194{ "add_bos_token": true, "add_eos_token": false, "add_prefix_space": null, "added_tokens_decoder": { "32000": { "content": "õ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32001": { "content": "÷", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32002": { "content": "Á", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32003": { "content": "ý", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32004": { "content": "À", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32005": { "content": "ÿ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32006": { "content": "ø", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32007": { "content": "ú", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32008": { "content": "þ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32009": { "content": "ü", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32010": { "content": "ù", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32011": { "content": "ö", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32012": { "content": "û", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32013": { "content": "<|begin▁of▁sentence|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true }, "32014": { "content": "<|end▁of▁sentence|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true }, "32015": { "content": "<|fim▁hole|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32016": { "content": "<|fim▁begin|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32017": { "content": "<|fim▁end|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32018": { "content": "<pad>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32019": { "content": "<|User|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32020": { "content": "<|Assistant|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "32021": { "content": "<|EOT|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true } }, "bos_token": "<|begin▁of▁sentence|>", "clean_up_tokenization_spaces": false, "eos_token": "<|EOT|>", "extra_special_tokens": {}, "legacy": true, "model_max_length": 34958, "pad_token": "<|end▁of▁sentence|>", "sp_model_kwargs": {}, "tokenizer_class": "LlamaTokenizerFast", "unk_token": null, "use_default_system_prompt": false}README.md+110-3
adapter_config.jsonAdded+42
adapter_model.safetensorsAdded+3
chat_template.jinjaAdded+26
special_tokens_map.jsonAdded+23
tokenizer.jsonAdded
tokenizer_config.jsonAdded+194