Text Generation
PEFT
Safetensors
Transformers
qwen2
axolotl
lora
conversational
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use alokeshproy1964/security-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use alokeshproy1964/security-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct") model = PeftModel.from_pretrained(base_model, "alokeshproy1964/security-lora") - Transformers
How to use alokeshproy1964/security-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="alokeshproy1964/security-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("alokeshproy1964/security-lora") model = AutoModelForCausalLM.from_pretrained("alokeshproy1964/security-lora", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use alokeshproy1964/security-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alokeshproy1964/security-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alokeshproy1964/security-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/alokeshproy1964/security-lora
- SGLang
How to use alokeshproy1964/security-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "alokeshproy1964/security-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alokeshproy1964/security-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "alokeshproy1964/security-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alokeshproy1964/security-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use alokeshproy1964/security-lora with Docker Model Runner:
docker model run hf.co/alokeshproy1964/security-lora
See axolotl config
axolotl version: 0.17.0.dev0
base_model: Qwen/Qwen2.5-0.5B-Instruct
load_in_4bit: true
adapter: qlora
lora_r: 8
lora_alpha: 16
lora_dropout: 0.0
lora_target_modules:
- q_proj
- k_proj
- v_proj
- o_proj
- gate_proj
- up_proj
- down_proj
micro_batch_size: 1
gradient_accumulation_steps: 2
num_epochs: 1
learning_rate: 2e-4
sequence_len: 512
- path: /workspace/datasets/real_data.jsonl
type: alpaca
output_dir: /workspace/output/run1
val_set_size: 0.1
eval_strategy: steps
eval_steps: 10
workspace/output/run1
This model is a fine-tuned version of Qwen/Qwen2.5-0.5B-Instruct on the /workspace/datasets/real_data.jsonl dataset. It achieves the following results on the evaluation set:
- Loss: 0.0219
- Ppl: 1.0222
- Memory/max Active (gib): 0.58
- Memory/max Allocated (gib): 0.58
- Memory/device Reserved (gib): 0.71
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: 1
- eval_batch_size: 1
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 2
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED 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: 2
- training_steps: 45
Training results
| Training Loss | Epoch | Step | Validation Loss | Ppl | Active (gib) | Allocated (gib) | Reserved (gib) |
|---|---|---|---|---|---|---|---|
| No log | 0 | 0 | 3.6679 | 39.1691 | 0.54 | 0.54 | 0.96 |
| 1.9445 | 0.2222 | 10 | 1.1011 | 3.0074 | 0.58 | 0.58 | 0.71 |
| 0.0700 | 0.4444 | 20 | 0.1646 | 1.1790 | 0.58 | 0.58 | 0.71 |
| 0.0087 | 0.6667 | 30 | 0.0791 | 1.0823 | 0.58 | 0.58 | 0.71 |
| 0.0062 | 0.8889 | 40 | 0.0411 | 1.0420 | 0.58 | 0.58 | 0.71 |
| 0.0386 | 1.0 | 45 | 0.0219 | 1.0222 | 0.58 | 0.58 | 0.71 |
Framework versions
- PEFT 0.19.1
- Transformers 5.10.2
- Pytorch 2.10.0+cu128
- Datasets 4.8.5
- Tokenizers 0.22.2
- Downloads last month
- 29