Fredrik Hansen
commited on
Commit
·
d347e23
0
Parent(s):
Initial release: SecurityGPT 14B
Browse files- .gitattributes +37 -0
- DEPLOYMENT.md +760 -0
- README.md +379 -0
- USAGE_EXAMPLES.md +657 -0
- added_tokens.json +24 -0
- chat_template.jinja +54 -0
- config.json +80 -0
- generation_config.json +12 -0
- merges.txt +0 -0
- model-00001-of-00006.safetensors +3 -0
- model-00002-of-00006.safetensors +3 -0
- model-00003-of-00006.safetensors +3 -0
- model.safetensors.index.json +586 -0
- special_tokens_map.json +31 -0
- tokenizer.json +3 -0
- tokenizer_config.json +209 -0
- vocab.json +0 -0
.gitattributes
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gguf filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
DEPLOYMENT.md
ADDED
|
@@ -0,0 +1,760 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SecurityGPT Deployment Guide
|
| 2 |
+
|
| 3 |
+
Comprehensive guide for deploying SecurityGPT in various environments.
|
| 4 |
+
|
| 5 |
+
## Table of Contents
|
| 6 |
+
|
| 7 |
+
1. [Quick Start](#quick-start)
|
| 8 |
+
2. [Hugging Face Hub](#hugging-face-hub)
|
| 9 |
+
3. [Ollama Deployment](#ollama-deployment)
|
| 10 |
+
4. [Docker Deployment](#docker-deployment)
|
| 11 |
+
5. [API Server](#api-server)
|
| 12 |
+
6. [Cloud Deployment](#cloud-deployment)
|
| 13 |
+
7. [Production Considerations](#production-considerations)
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## Quick Start
|
| 18 |
+
|
| 19 |
+
### Option 1: Hugging Face Transformers (Simplest)
|
| 20 |
+
|
| 21 |
+
```python
|
| 22 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 23 |
+
|
| 24 |
+
model_name = "pki/securitygpt-14b"
|
| 25 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 26 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 27 |
+
model_name,
|
| 28 |
+
device_map="auto",
|
| 29 |
+
trust_remote_code=True
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
# Generate
|
| 33 |
+
messages = [{"role": "user", "content": "Create a FastAPI endpoint"}]
|
| 34 |
+
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
|
| 35 |
+
outputs = model.generate(inputs.to("cuda"), max_new_tokens=512)
|
| 36 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
### Option 2: Ollama (Recommended for Production)
|
| 40 |
+
|
| 41 |
+
```bash
|
| 42 |
+
# Download GGUF model
|
| 43 |
+
wget https://huggingface.co/pki/securitygpt-14b/resolve/main/securitygpt-14b-q8.gguf
|
| 44 |
+
|
| 45 |
+
# Create Modelfile
|
| 46 |
+
cat > Modelfile <<EOF
|
| 47 |
+
FROM ./securitygpt-14b-q8.gguf
|
| 48 |
+
PARAMETER temperature 0.7
|
| 49 |
+
PARAMETER num_ctx 32768
|
| 50 |
+
EOF
|
| 51 |
+
|
| 52 |
+
# Deploy
|
| 53 |
+
ollama create securitygpt:14b -f Modelfile
|
| 54 |
+
ollama run securitygpt:14b
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
## Hugging Face Hub
|
| 60 |
+
|
| 61 |
+
### Upload Model to Hub
|
| 62 |
+
|
| 63 |
+
**Prerequisites:**
|
| 64 |
+
- Hugging Face account
|
| 65 |
+
- Hub token with write access
|
| 66 |
+
- git-lfs installed
|
| 67 |
+
|
| 68 |
+
**Step 1: Install Requirements**
|
| 69 |
+
```bash
|
| 70 |
+
pip install huggingface_hub
|
| 71 |
+
huggingface-cli login
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
**Step 2: Prepare Model Files**
|
| 75 |
+
```bash
|
| 76 |
+
cd llm-training-repo/models
|
| 77 |
+
cp merged_gguf_q4/* ../huggingface/
|
| 78 |
+
|
| 79 |
+
# Or upload merged PyTorch model
|
| 80 |
+
cp -r merged_model/* ../huggingface/
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
**Step 3: Create Repository**
|
| 84 |
+
```python
|
| 85 |
+
from huggingface_hub import HfApi, create_repo
|
| 86 |
+
|
| 87 |
+
api = HfApi()
|
| 88 |
+
|
| 89 |
+
# Create repo
|
| 90 |
+
repo_id = "pki/securitygpt-14b"
|
| 91 |
+
create_repo(repo_id, private=False, repo_type="model")
|
| 92 |
+
|
| 93 |
+
# Upload model files
|
| 94 |
+
api.upload_folder(
|
| 95 |
+
folder_path="./huggingface",
|
| 96 |
+
repo_id=repo_id,
|
| 97 |
+
repo_type="model"
|
| 98 |
+
)
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
**Step 4: Test Download**
|
| 102 |
+
```python
|
| 103 |
+
from transformers import AutoModelForCausalLM
|
| 104 |
+
|
| 105 |
+
model = AutoModelForCausalLM.from_pretrained("pki/securitygpt-14b")
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
### Model Card on Hub
|
| 109 |
+
|
| 110 |
+
The `MODEL_CARD.md` should be renamed to `README.md` in your Hub repo:
|
| 111 |
+
|
| 112 |
+
```bash
|
| 113 |
+
cp huggingface/MODEL_CARD.md huggingface/README.md
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
---
|
| 117 |
+
|
| 118 |
+
## Ollama Deployment
|
| 119 |
+
|
| 120 |
+
Ollama provides the easiest deployment for local and production use.
|
| 121 |
+
|
| 122 |
+
### Local Deployment
|
| 123 |
+
|
| 124 |
+
**Step 1: Install Ollama**
|
| 125 |
+
```bash
|
| 126 |
+
# Linux
|
| 127 |
+
curl -fsSL https://ollama.com/install.sh | sh
|
| 128 |
+
|
| 129 |
+
# macOS
|
| 130 |
+
brew install ollama
|
| 131 |
+
|
| 132 |
+
# Windows
|
| 133 |
+
# Download from https://ollama.com/download
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
**Step 2: Get GGUF Model**
|
| 137 |
+
|
| 138 |
+
Option A: Download from Hugging Face
|
| 139 |
+
```bash
|
| 140 |
+
wget https://huggingface.co/pki/securitygpt-14b/resolve/main/securitygpt-14b-q8.gguf
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
Option B: Convert locally (if you have PyTorch model)
|
| 144 |
+
```bash
|
| 145 |
+
# Clone llama.cpp
|
| 146 |
+
git clone https://github.com/ggerganov/llama.cpp
|
| 147 |
+
cd llama.cpp
|
| 148 |
+
make
|
| 149 |
+
|
| 150 |
+
# Convert
|
| 151 |
+
python convert_hf_to_gguf.py /path/to/merged_model \
|
| 152 |
+
--outfile securitygpt-14b-f16.gguf --outtype f16
|
| 153 |
+
|
| 154 |
+
# Quantize
|
| 155 |
+
./llama-quantize securitygpt-14b-f16.gguf securitygpt-14b-q8.gguf Q8_0
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
**Step 3: Create Modelfile**
|
| 159 |
+
```dockerfile
|
| 160 |
+
FROM ./securitygpt-14b-q8.gguf
|
| 161 |
+
|
| 162 |
+
PARAMETER temperature 0.7
|
| 163 |
+
PARAMETER top_p 0.9
|
| 164 |
+
PARAMETER top_k 50
|
| 165 |
+
PARAMETER num_ctx 32768
|
| 166 |
+
PARAMETER num_predict 2048
|
| 167 |
+
PARAMETER stop "<|im_start|>"
|
| 168 |
+
PARAMETER stop "<|im_end|>"
|
| 169 |
+
|
| 170 |
+
TEMPLATE """<|im_start|>system
|
| 171 |
+
{{ .System }}<|im_end|>
|
| 172 |
+
<|im_start|>user
|
| 173 |
+
{{ .Prompt }}<|im_end|>
|
| 174 |
+
<|im_start|>assistant
|
| 175 |
+
"""
|
| 176 |
+
|
| 177 |
+
SYSTEM """You are SecurityGPT, a specialized AI assistant for secure software development. You follow security best practices including: argon2 password hashing (NEVER bcrypt), input validation, SQL injection prevention, XSS protection, proper authentication, and comprehensive error handling."""
|
| 178 |
+
|
| 179 |
+
MESSAGE user "Create a FastAPI endpoint for user authentication"
|
| 180 |
+
MESSAGE assistant "I'll create a secure FastAPI authentication endpoint with argon2 password hashing, JWT tokens, and proper validation..."
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
**Step 4: Deploy**
|
| 184 |
+
```bash
|
| 185 |
+
ollama create securitygpt:14b -f Modelfile
|
| 186 |
+
ollama list # Verify it's listed
|
| 187 |
+
|
| 188 |
+
# Test
|
| 189 |
+
ollama run securitygpt:14b "Create a secure login endpoint"
|
| 190 |
+
```
|
| 191 |
+
|
| 192 |
+
### Remote Deployment
|
| 193 |
+
|
| 194 |
+
**Deploy to Remote Server:**
|
| 195 |
+
```bash
|
| 196 |
+
# Copy GGUF to server
|
| 197 |
+
scp securitygpt-14b-q8.gguf user@server:/models/
|
| 198 |
+
scp Modelfile user@server:/models/
|
| 199 |
+
|
| 200 |
+
# SSH to server
|
| 201 |
+
ssh user@server
|
| 202 |
+
|
| 203 |
+
# Create model
|
| 204 |
+
cd /models
|
| 205 |
+
ollama create securitygpt:14b -f Modelfile
|
| 206 |
+
|
| 207 |
+
# Serve (if not running)
|
| 208 |
+
ollama serve
|
| 209 |
+
```
|
| 210 |
+
|
| 211 |
+
**Access remotely:**
|
| 212 |
+
```bash
|
| 213 |
+
# Set Ollama host
|
| 214 |
+
export OLLAMA_HOST=http://server-ip:11434
|
| 215 |
+
|
| 216 |
+
# Use
|
| 217 |
+
ollama run securitygpt:14b "Your prompt"
|
| 218 |
+
```
|
| 219 |
+
|
| 220 |
+
### Ollama with Docker
|
| 221 |
+
|
| 222 |
+
```bash
|
| 223 |
+
# Run Ollama in container
|
| 224 |
+
docker run -d \
|
| 225 |
+
--name ollama \
|
| 226 |
+
--gpus all \
|
| 227 |
+
-v ollama-data:/root/.ollama \
|
| 228 |
+
-p 11434:11434 \
|
| 229 |
+
ollama/ollama
|
| 230 |
+
|
| 231 |
+
# Create model inside container
|
| 232 |
+
docker exec -it ollama ollama create securitygpt:14b -f /path/to/Modelfile
|
| 233 |
+
```
|
| 234 |
+
|
| 235 |
+
---
|
| 236 |
+
|
| 237 |
+
## Docker Deployment
|
| 238 |
+
|
| 239 |
+
### Custom Docker Image
|
| 240 |
+
|
| 241 |
+
**Dockerfile:**
|
| 242 |
+
```dockerfile
|
| 243 |
+
FROM nvidia/cuda:12.4.0-runtime-ubuntu22.04
|
| 244 |
+
|
| 245 |
+
# Install Python
|
| 246 |
+
RUN apt-get update && apt-get install -y \
|
| 247 |
+
python3.11 \
|
| 248 |
+
python3-pip \
|
| 249 |
+
git \
|
| 250 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 251 |
+
|
| 252 |
+
# Install dependencies
|
| 253 |
+
COPY requirements.txt .
|
| 254 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 255 |
+
|
| 256 |
+
# Copy model (or download in entrypoint)
|
| 257 |
+
COPY merged_model /app/model
|
| 258 |
+
|
| 259 |
+
# API server
|
| 260 |
+
COPY api_server.py /app/
|
| 261 |
+
WORKDIR /app
|
| 262 |
+
|
| 263 |
+
EXPOSE 8000
|
| 264 |
+
|
| 265 |
+
CMD ["python3", "api_server.py"]
|
| 266 |
+
```
|
| 267 |
+
|
| 268 |
+
**requirements.txt:**
|
| 269 |
+
```
|
| 270 |
+
transformers==4.57.3
|
| 271 |
+
torch==2.5.0
|
| 272 |
+
fastapi==0.110.0
|
| 273 |
+
uvicorn[standard]==0.27.0
|
| 274 |
+
pydantic==2.10.0
|
| 275 |
+
```
|
| 276 |
+
|
| 277 |
+
**api_server.py:**
|
| 278 |
+
```python
|
| 279 |
+
from fastapi import FastAPI, HTTPException
|
| 280 |
+
from pydantic import BaseModel
|
| 281 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 282 |
+
import torch
|
| 283 |
+
|
| 284 |
+
app = FastAPI(title="SecurityGPT API")
|
| 285 |
+
|
| 286 |
+
# Load model on startup
|
| 287 |
+
@app.on_event("startup")
|
| 288 |
+
async def load_model():
|
| 289 |
+
global model, tokenizer
|
| 290 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 291 |
+
"/app/model",
|
| 292 |
+
torch_dtype=torch.bfloat16,
|
| 293 |
+
device_map="auto"
|
| 294 |
+
)
|
| 295 |
+
tokenizer = AutoTokenizer.from_pretrained("/app/model")
|
| 296 |
+
|
| 297 |
+
class GenerateRequest(BaseModel):
|
| 298 |
+
prompt: str
|
| 299 |
+
max_tokens: int = 512
|
| 300 |
+
temperature: float = 0.7
|
| 301 |
+
|
| 302 |
+
@app.post("/generate")
|
| 303 |
+
async def generate(request: GenerateRequest):
|
| 304 |
+
try:
|
| 305 |
+
messages = [{"role": "user", "content": request.prompt}]
|
| 306 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 307 |
+
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 308 |
+
|
| 309 |
+
outputs = model.generate(
|
| 310 |
+
**inputs,
|
| 311 |
+
max_new_tokens=request.max_tokens,
|
| 312 |
+
temperature=request.temperature
|
| 313 |
+
)
|
| 314 |
+
|
| 315 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 316 |
+
return {"response": response}
|
| 317 |
+
except Exception as e:
|
| 318 |
+
raise HTTPException(500, str(e))
|
| 319 |
+
|
| 320 |
+
@app.get("/health")
|
| 321 |
+
async def health():
|
| 322 |
+
return {"status": "healthy"}
|
| 323 |
+
|
| 324 |
+
if __name__ == "__main__":
|
| 325 |
+
import uvicorn
|
| 326 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|
| 327 |
+
```
|
| 328 |
+
|
| 329 |
+
**Build and Run:**
|
| 330 |
+
```bash
|
| 331 |
+
docker build -t securitygpt:14b .
|
| 332 |
+
|
| 333 |
+
docker run -d \
|
| 334 |
+
--name securitygpt-api \
|
| 335 |
+
--gpus all \
|
| 336 |
+
-p 8000:8000 \
|
| 337 |
+
securitygpt:14b
|
| 338 |
+
```
|
| 339 |
+
|
| 340 |
+
**Test:**
|
| 341 |
+
```bash
|
| 342 |
+
curl -X POST http://localhost:8000/generate \
|
| 343 |
+
-H "Content-Type: application/json" \
|
| 344 |
+
-d '{"prompt": "Create a FastAPI endpoint", "max_tokens": 512}'
|
| 345 |
+
```
|
| 346 |
+
|
| 347 |
+
---
|
| 348 |
+
|
| 349 |
+
## API Server
|
| 350 |
+
|
| 351 |
+
### FastAPI Server (Production-Ready)
|
| 352 |
+
|
| 353 |
+
**server.py:**
|
| 354 |
+
```python
|
| 355 |
+
from fastapi import FastAPI, HTTPException, Depends, Security
|
| 356 |
+
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
| 357 |
+
from pydantic import BaseModel, Field
|
| 358 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 359 |
+
import torch
|
| 360 |
+
import logging
|
| 361 |
+
|
| 362 |
+
# Setup logging
|
| 363 |
+
logging.basicConfig(level=logging.INFO)
|
| 364 |
+
logger = logging.getLogger(__name__)
|
| 365 |
+
|
| 366 |
+
# Security
|
| 367 |
+
security = HTTPBearer()
|
| 368 |
+
|
| 369 |
+
app = FastAPI(
|
| 370 |
+
title="SecurityGPT API",
|
| 371 |
+
description="Secure code generation API",
|
| 372 |
+
version="1.0.0"
|
| 373 |
+
)
|
| 374 |
+
|
| 375 |
+
# Global model storage
|
| 376 |
+
model = None
|
| 377 |
+
tokenizer = None
|
| 378 |
+
|
| 379 |
+
@app.on_event("startup")
|
| 380 |
+
async def startup_event():
|
| 381 |
+
global model, tokenizer
|
| 382 |
+
logger.info("Loading SecurityGPT model...")
|
| 383 |
+
|
| 384 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 385 |
+
"pki/securitygpt-14b",
|
| 386 |
+
torch_dtype=torch.bfloat16,
|
| 387 |
+
device_map="auto",
|
| 388 |
+
trust_remote_code=True
|
| 389 |
+
)
|
| 390 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 391 |
+
"pki/securitygpt-14b",
|
| 392 |
+
trust_remote_code=True
|
| 393 |
+
)
|
| 394 |
+
|
| 395 |
+
logger.info("Model loaded successfully")
|
| 396 |
+
|
| 397 |
+
class GenerateRequest(BaseModel):
|
| 398 |
+
prompt: str = Field(..., min_length=1, max_length=8000)
|
| 399 |
+
system_prompt: str = Field(
|
| 400 |
+
default="You are a security-focused coding assistant.",
|
| 401 |
+
max_length=500
|
| 402 |
+
)
|
| 403 |
+
max_tokens: int = Field(default=512, ge=1, le=2048)
|
| 404 |
+
temperature: float = Field(default=0.7, ge=0.0, le=2.0)
|
| 405 |
+
top_p: float = Field(default=0.9, ge=0.0, le=1.0)
|
| 406 |
+
|
| 407 |
+
class GenerateResponse(BaseModel):
|
| 408 |
+
response: str
|
| 409 |
+
tokens_generated: int
|
| 410 |
+
|
| 411 |
+
def verify_token(credentials: HTTPAuthorizationCredentials = Security(security)):
|
| 412 |
+
"""Verify API token (implement your auth logic)."""
|
| 413 |
+
token = credentials.credentials
|
| 414 |
+
# TODO: Implement actual token verification
|
| 415 |
+
if token != "your-secret-token":
|
| 416 |
+
raise HTTPException(401, "Invalid token")
|
| 417 |
+
return token
|
| 418 |
+
|
| 419 |
+
@app.post("/api/v1/generate", response_model=GenerateResponse)
|
| 420 |
+
async def generate(
|
| 421 |
+
request: GenerateRequest,
|
| 422 |
+
token: str = Depends(verify_token)
|
| 423 |
+
):
|
| 424 |
+
"""Generate code based on prompt."""
|
| 425 |
+
try:
|
| 426 |
+
messages = [
|
| 427 |
+
{"role": "system", "content": request.system_prompt},
|
| 428 |
+
{"role": "user", "content": request.prompt}
|
| 429 |
+
]
|
| 430 |
+
|
| 431 |
+
text = tokenizer.apply_chat_template(
|
| 432 |
+
messages,
|
| 433 |
+
tokenize=False,
|
| 434 |
+
add_generation_prompt=True
|
| 435 |
+
)
|
| 436 |
+
|
| 437 |
+
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 438 |
+
|
| 439 |
+
outputs = model.generate(
|
| 440 |
+
**inputs,
|
| 441 |
+
max_new_tokens=request.max_tokens,
|
| 442 |
+
temperature=request.temperature,
|
| 443 |
+
top_p=request.top_p,
|
| 444 |
+
do_sample=True
|
| 445 |
+
)
|
| 446 |
+
|
| 447 |
+
response_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 448 |
+
tokens_generated = len(outputs[0]) - len(inputs['input_ids'][0])
|
| 449 |
+
|
| 450 |
+
return GenerateResponse(
|
| 451 |
+
response=response_text,
|
| 452 |
+
tokens_generated=tokens_generated
|
| 453 |
+
)
|
| 454 |
+
|
| 455 |
+
except Exception as e:
|
| 456 |
+
logger.error(f"Generation error: {str(e)}")
|
| 457 |
+
raise HTTPException(500, f"Generation failed: {str(e)}")
|
| 458 |
+
|
| 459 |
+
@app.get("/health")
|
| 460 |
+
async def health():
|
| 461 |
+
"""Health check endpoint."""
|
| 462 |
+
return {
|
| 463 |
+
"status": "healthy",
|
| 464 |
+
"model_loaded": model is not None
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
if __name__ == "__main__":
|
| 468 |
+
import uvicorn
|
| 469 |
+
uvicorn.run(
|
| 470 |
+
app,
|
| 471 |
+
host="0.0.0.0",
|
| 472 |
+
port=8000,
|
| 473 |
+
log_level="info"
|
| 474 |
+
)
|
| 475 |
+
```
|
| 476 |
+
|
| 477 |
+
**Run:**
|
| 478 |
+
```bash
|
| 479 |
+
python server.py
|
| 480 |
+
```
|
| 481 |
+
|
| 482 |
+
**Client Example:**
|
| 483 |
+
```python
|
| 484 |
+
import requests
|
| 485 |
+
|
| 486 |
+
response = requests.post(
|
| 487 |
+
"http://localhost:8000/api/v1/generate",
|
| 488 |
+
headers={"Authorization": "Bearer your-secret-token"},
|
| 489 |
+
json={
|
| 490 |
+
"prompt": "Create a FastAPI user signup endpoint",
|
| 491 |
+
"max_tokens": 512,
|
| 492 |
+
"temperature": 0.7
|
| 493 |
+
}
|
| 494 |
+
)
|
| 495 |
+
|
| 496 |
+
print(response.json()['response'])
|
| 497 |
+
```
|
| 498 |
+
|
| 499 |
+
---
|
| 500 |
+
|
| 501 |
+
## Cloud Deployment
|
| 502 |
+
|
| 503 |
+
### AWS EC2
|
| 504 |
+
|
| 505 |
+
**Instance Recommendations:**
|
| 506 |
+
- **g5.xlarge** - 1x A10G (24GB VRAM) - $1.006/hr
|
| 507 |
+
- **g5.2xlarge** - 1x A10G (24GB VRAM) + more CPU/RAM - $1.212/hr
|
| 508 |
+
- **p3.2xlarge** - 1x V100 (16GB VRAM) - needs Q4 quantization
|
| 509 |
+
|
| 510 |
+
**Setup:**
|
| 511 |
+
```bash
|
| 512 |
+
# Launch instance with Deep Learning AMI
|
| 513 |
+
# SSH to instance
|
| 514 |
+
|
| 515 |
+
# Install Ollama
|
| 516 |
+
curl -fsSL https://ollama.com/install.sh | sh
|
| 517 |
+
|
| 518 |
+
# Download model
|
| 519 |
+
wget https://huggingface.co/pki/securitygpt-14b/resolve/main/securitygpt-14b-q8.gguf
|
| 520 |
+
|
| 521 |
+
# Deploy
|
| 522 |
+
ollama create securitygpt:14b -f Modelfile
|
| 523 |
+
ollama serve
|
| 524 |
+
```
|
| 525 |
+
|
| 526 |
+
### Google Cloud Platform
|
| 527 |
+
|
| 528 |
+
**Instance Recommendations:**
|
| 529 |
+
- **n1-standard-4 + 1x NVIDIA T4** - $0.35/hr + $0.35/hr
|
| 530 |
+
- **n1-standard-8 + 1x NVIDIA A100** - Better performance
|
| 531 |
+
|
| 532 |
+
**Setup:**
|
| 533 |
+
```bash
|
| 534 |
+
# Create instance with GPU
|
| 535 |
+
gcloud compute instances create securitygpt \
|
| 536 |
+
--zone=us-central1-a \
|
| 537 |
+
--machine-type=n1-standard-4 \
|
| 538 |
+
--accelerator=type=nvidia-tesla-t4,count=1 \
|
| 539 |
+
--image-family=pytorch-latest-gpu \
|
| 540 |
+
--image-project=deeplearning-platform-release
|
| 541 |
+
|
| 542 |
+
# SSH and deploy
|
| 543 |
+
gcloud compute ssh securitygpt
|
| 544 |
+
# ... install Ollama and model
|
| 545 |
+
```
|
| 546 |
+
|
| 547 |
+
### Azure
|
| 548 |
+
|
| 549 |
+
**VM Recommendations:**
|
| 550 |
+
- **NC6s_v3** - 1x V100 (16GB) - Q4 quantization required
|
| 551 |
+
- **NC24ads_A100_v4** - 1x A100 (80GB) - Full model + headroom
|
| 552 |
+
|
| 553 |
+
### Runpod / Lambda Labs / Vast.ai
|
| 554 |
+
|
| 555 |
+
**Budget GPU Cloud Options:**
|
| 556 |
+
|
| 557 |
+
```bash
|
| 558 |
+
# Runpod example
|
| 559 |
+
# 1. Create pod with RTX 4090
|
| 560 |
+
# 2. Use Jupyter or SSH template
|
| 561 |
+
# 3. Deploy Ollama
|
| 562 |
+
|
| 563 |
+
pip install runpod
|
| 564 |
+
# ... follow Runpod deployment docs
|
| 565 |
+
```
|
| 566 |
+
|
| 567 |
+
---
|
| 568 |
+
|
| 569 |
+
## Production Considerations
|
| 570 |
+
|
| 571 |
+
### Performance Optimization
|
| 572 |
+
|
| 573 |
+
**1. Quantization Choice**
|
| 574 |
+
|
| 575 |
+
| Quantization | Size | VRAM | Quality | Speed |
|
| 576 |
+
|--------------|------|------|---------|-------|
|
| 577 |
+
| FP16 | 28GB | 28GB | Best | Slowest |
|
| 578 |
+
| Q8_0 | 15GB | 16GB | Excellent | Fast |
|
| 579 |
+
| Q5_K_M | 10GB | 12GB | Good | Faster |
|
| 580 |
+
| Q4_K_M | 8GB | 10GB | Acceptable | Fastest |
|
| 581 |
+
|
| 582 |
+
**Recommendation:** Q8_0 for production (best quality/speed trade-off)
|
| 583 |
+
|
| 584 |
+
**2. Batching**
|
| 585 |
+
|
| 586 |
+
```python
|
| 587 |
+
# Process multiple prompts efficiently
|
| 588 |
+
prompts = ["prompt1", "prompt2", "prompt3"]
|
| 589 |
+
|
| 590 |
+
# Tokenize all at once
|
| 591 |
+
inputs = tokenizer(prompts, return_tensors="pt", padding=True).to("cuda")
|
| 592 |
+
|
| 593 |
+
# Generate batch
|
| 594 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 595 |
+
|
| 596 |
+
# Decode all
|
| 597 |
+
responses = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 598 |
+
```
|
| 599 |
+
|
| 600 |
+
**3. Caching**
|
| 601 |
+
|
| 602 |
+
```python
|
| 603 |
+
import redis
|
| 604 |
+
import hashlib
|
| 605 |
+
|
| 606 |
+
redis_client = redis.Redis(host='localhost', port=6379)
|
| 607 |
+
|
| 608 |
+
def generate_cached(prompt: str):
|
| 609 |
+
# Check cache
|
| 610 |
+
cache_key = hashlib.sha256(prompt.encode()).hexdigest()
|
| 611 |
+
cached = redis_client.get(cache_key)
|
| 612 |
+
|
| 613 |
+
if cached:
|
| 614 |
+
return cached.decode()
|
| 615 |
+
|
| 616 |
+
# Generate
|
| 617 |
+
response = generate(prompt)
|
| 618 |
+
|
| 619 |
+
# Cache for 1 hour
|
| 620 |
+
redis_client.setex(cache_key, 3600, response)
|
| 621 |
+
|
| 622 |
+
return response
|
| 623 |
+
```
|
| 624 |
+
|
| 625 |
+
### Monitoring
|
| 626 |
+
|
| 627 |
+
**Prometheus Metrics:**
|
| 628 |
+
```python
|
| 629 |
+
from prometheus_client import Counter, Histogram, Gauge
|
| 630 |
+
import time
|
| 631 |
+
|
| 632 |
+
requests_total = Counter('securitygpt_requests_total', 'Total requests')
|
| 633 |
+
request_duration = Histogram('securitygpt_request_duration_seconds', 'Request duration')
|
| 634 |
+
tokens_generated = Counter('securitygpt_tokens_generated_total', 'Total tokens generated')
|
| 635 |
+
gpu_memory = Gauge('securitygpt_gpu_memory_bytes', 'GPU memory usage')
|
| 636 |
+
|
| 637 |
+
@app.post("/generate")
|
| 638 |
+
async def generate(request: GenerateRequest):
|
| 639 |
+
requests_total.inc()
|
| 640 |
+
|
| 641 |
+
start_time = time.time()
|
| 642 |
+
|
| 643 |
+
# ... generation logic ...
|
| 644 |
+
|
| 645 |
+
request_duration.observe(time.time() - start_time)
|
| 646 |
+
tokens_generated.inc(num_tokens)
|
| 647 |
+
|
| 648 |
+
# Update GPU memory
|
| 649 |
+
if torch.cuda.is_available():
|
| 650 |
+
gpu_memory.set(torch.cuda.memory_allocated())
|
| 651 |
+
|
| 652 |
+
return response
|
| 653 |
+
```
|
| 654 |
+
|
| 655 |
+
### Security
|
| 656 |
+
|
| 657 |
+
**API Authentication:**
|
| 658 |
+
```python
|
| 659 |
+
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
| 660 |
+
from jose import jwt
|
| 661 |
+
|
| 662 |
+
SECRET_KEY = "your-secret-key"
|
| 663 |
+
|
| 664 |
+
def verify_jwt(credentials: HTTPAuthorizationCredentials):
|
| 665 |
+
try:
|
| 666 |
+
payload = jwt.decode(credentials.credentials, SECRET_KEY, algorithms=["HS256"])
|
| 667 |
+
return payload
|
| 668 |
+
except:
|
| 669 |
+
raise HTTPException(401, "Invalid token")
|
| 670 |
+
```
|
| 671 |
+
|
| 672 |
+
**Rate Limiting:**
|
| 673 |
+
```python
|
| 674 |
+
from slowapi import Limiter
|
| 675 |
+
from slowapi.util import get_remote_address
|
| 676 |
+
|
| 677 |
+
limiter = Limiter(key_func=get_remote_address)
|
| 678 |
+
app.state.limiter = limiter
|
| 679 |
+
|
| 680 |
+
@app.post("/generate")
|
| 681 |
+
@limiter.limit("10/minute")
|
| 682 |
+
async def generate(request: Request, ...):
|
| 683 |
+
...
|
| 684 |
+
```
|
| 685 |
+
|
| 686 |
+
### Scaling
|
| 687 |
+
|
| 688 |
+
**Horizontal Scaling with Load Balancer:**
|
| 689 |
+
|
| 690 |
+
```
|
| 691 |
+
┌─────────────┐
|
| 692 |
+
│ Nginx LB │
|
| 693 |
+
└──────┬──────┘
|
| 694 |
+
│
|
| 695 |
+
┌─────────┬────────┼────────┬─────────┐
|
| 696 |
+
│ │ │ │ │
|
| 697 |
+
┌────▼───┐ ┌──▼────┐ ┌─▼─────┐ ┌▼────────┐
|
| 698 |
+
│ API 1 │ │ API 2 │ │ API 3 │ │ API N │
|
| 699 |
+
│+ Model │ │+ Model│ │+ Model│ │+ Model │
|
| 700 |
+
└────────┘ └───────┘ └───────┘ └─────────┘
|
| 701 |
+
```
|
| 702 |
+
|
| 703 |
+
**Nginx config:**
|
| 704 |
+
```nginx
|
| 705 |
+
upstream securitygpt_backend {
|
| 706 |
+
server 10.0.1.10:8000;
|
| 707 |
+
server 10.0.1.11:8000;
|
| 708 |
+
server 10.0.1.12:8000;
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
server {
|
| 712 |
+
listen 80;
|
| 713 |
+
location /api {
|
| 714 |
+
proxy_pass http://securitygpt_backend;
|
| 715 |
+
}
|
| 716 |
+
}
|
| 717 |
+
```
|
| 718 |
+
|
| 719 |
+
---
|
| 720 |
+
|
| 721 |
+
## Troubleshooting
|
| 722 |
+
|
| 723 |
+
### Model Won't Load
|
| 724 |
+
|
| 725 |
+
**Check:**
|
| 726 |
+
1. GPU availability: `nvidia-smi`
|
| 727 |
+
2. VRAM sufficient for model size
|
| 728 |
+
3. CUDA version compatible with PyTorch
|
| 729 |
+
4. Model files not corrupted
|
| 730 |
+
|
| 731 |
+
### Slow Inference
|
| 732 |
+
|
| 733 |
+
**Check:**
|
| 734 |
+
1. GPU utilization (`nvidia-smi`)
|
| 735 |
+
2. Using CUDA (`model.device`)
|
| 736 |
+
3. Quantization applied
|
| 737 |
+
4. Batch size not too large
|
| 738 |
+
|
| 739 |
+
### Out of Memory
|
| 740 |
+
|
| 741 |
+
**Solutions:**
|
| 742 |
+
1. Use smaller quantization (Q4 instead of Q8)
|
| 743 |
+
2. Reduce context length
|
| 744 |
+
3. Use gradient checkpointing
|
| 745 |
+
4. Clear CUDA cache: `torch.cuda.empty_cache()`
|
| 746 |
+
|
| 747 |
+
---
|
| 748 |
+
|
| 749 |
+
## Support
|
| 750 |
+
|
| 751 |
+
- **Issues:** GitHub/GitLab repository
|
| 752 |
+
- **Discussions:** Hugging Face model page
|
| 753 |
+
- **Documentation:** This deployment guide
|
| 754 |
+
|
| 755 |
+
---
|
| 756 |
+
|
| 757 |
+
**Ready to deploy!** Choose deployment method based on your needs:
|
| 758 |
+
- **Development:** Local Ollama
|
| 759 |
+
- **Production:** API server with Docker/K8s
|
| 760 |
+
- **Cloud:** AWS/G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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
base_model: Qwen/Qwen2.5-Coder-14B-Instruct
|
| 6 |
+
tags:
|
| 7 |
+
- security
|
| 8 |
+
- code-generation
|
| 9 |
+
- cybersecurity
|
| 10 |
+
- fastapi
|
| 11 |
+
- python
|
| 12 |
+
- typescript
|
| 13 |
+
- react
|
| 14 |
+
- qlora
|
| 15 |
+
- unsloth
|
| 16 |
+
model_type: qwen2
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
inference: true
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# SecurityGPT 14B
|
| 22 |
+
|
| 23 |
+
**SecurityGPT** is a 14-billion parameter code generation model fine-tuned for security-focused development tasks. Built on Qwen2.5-Coder-14B-Instruct, it specializes in generating secure, production-ready code with emphasis on best practices for web applications, API development, and cybersecurity.
|
| 24 |
+
|
| 25 |
+
## Model Description
|
| 26 |
+
|
| 27 |
+
- **Developed by:** [email protected]
|
| 28 |
+
- **Model type:** Causal Language Model (Decoder-only Transformer)
|
| 29 |
+
- **Language(s):** English
|
| 30 |
+
- **Base model:** [Qwen/Qwen2.5-Coder-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-14B-Instruct)
|
| 31 |
+
- **License:** Apache 2.0 (same as base model)
|
| 32 |
+
- **Finetuned from:** Qwen2.5-Coder-14B-Instruct
|
| 33 |
+
- **Context length:** 32,768 tokens
|
| 34 |
+
- **Parameters:** 14 billion
|
| 35 |
+
|
| 36 |
+
### Model Architecture
|
| 37 |
+
|
| 38 |
+
```
|
| 39 |
+
Architecture: Qwen2ForCausalLM
|
| 40 |
+
- Hidden size: 5,120
|
| 41 |
+
- Num layers: 48
|
| 42 |
+
- Attention heads: 40
|
| 43 |
+
- KV heads: 8 (GQA)
|
| 44 |
+
- Intermediate size: 13,824
|
| 45 |
+
- Vocab size: 152,064
|
| 46 |
+
- RoPE theta: 1,000,000
|
| 47 |
+
- Activation: SiLU
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
### Key Features
|
| 51 |
+
|
| 52 |
+
✅ **Security-First Design**
|
| 53 |
+
- Secure password hashing (argon2, NEVER bcrypt)
|
| 54 |
+
- SQL injection prevention
|
| 55 |
+
- XSS protection patterns
|
| 56 |
+
- Input validation & sanitization
|
| 57 |
+
- Proper authentication flows
|
| 58 |
+
|
| 59 |
+
✅ **Best Practice Enforcement**
|
| 60 |
+
- RESTful API design (`/api/v1/` versioning)
|
| 61 |
+
- Modern dependency management (Poetry for Python)
|
| 62 |
+
- Production-ready error handling
|
| 63 |
+
- Comprehensive audit logging
|
| 64 |
+
|
| 65 |
+
✅ **Technology Stack Coverage**
|
| 66 |
+
- **Backend:** Python, FastAPI, Flask, SQLAlchemy
|
| 67 |
+
- **Frontend:** React, TypeScript, Tailwind CSS
|
| 68 |
+
- **Databases:** PostgreSQL, Redis, OpenSearch
|
| 69 |
+
- **DevOps:** Docker, FreeBSD, GitLab CI/CD
|
| 70 |
+
|
| 71 |
+
## Intended Use
|
| 72 |
+
|
| 73 |
+
### Primary Use Cases
|
| 74 |
+
|
| 75 |
+
1. **Secure API Development** - Generate FastAPI/Flask endpoints with proper authentication, validation, and error handling
|
| 76 |
+
2. **Web Application Development** - Create React/TypeScript components following modern patterns
|
| 77 |
+
3. **Security Code Review** - Identify and fix security vulnerabilities in existing code
|
| 78 |
+
4. **Infrastructure as Code** - Generate secure deployment configurations
|
| 79 |
+
5. **DevOps Automation** - Create CI/CD pipelines and automation scripts
|
| 80 |
+
|
| 81 |
+
### Out-of-Scope Use
|
| 82 |
+
|
| 83 |
+
⚠️ This model is NOT intended for:
|
| 84 |
+
- Malicious code generation or exploit development
|
| 85 |
+
- Production security auditing (use professional security tools)
|
| 86 |
+
- Medical, legal, or financial advice
|
| 87 |
+
- Real-time critical systems without human review
|
| 88 |
+
|
| 89 |
+
## Training Details
|
| 90 |
+
|
| 91 |
+
### Training Method
|
| 92 |
+
|
| 93 |
+
**QLoRA (Quantized Low-Rank Adaptation)** using [Unsloth](https://github.com/unslothai/unsloth) for optimization.
|
| 94 |
+
|
| 95 |
+
**LoRA Configuration:**
|
| 96 |
+
```python
|
| 97 |
+
Rank (r): 128
|
| 98 |
+
Alpha: 256
|
| 99 |
+
Dropout: 0 (Unsloth optimized)
|
| 100 |
+
Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
| 101 |
+
Quantization: 4-bit (QLoRA)
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
**Training Hyperparameters:**
|
| 105 |
+
```python
|
| 106 |
+
Batch size: 8 per device
|
| 107 |
+
Gradient accumulation: 4 steps (effective batch = 32)
|
| 108 |
+
Learning rate: 1e-4
|
| 109 |
+
Epochs: 5
|
| 110 |
+
Max sequence length: 2,048 tokens
|
| 111 |
+
Optimizer: AdamW 8-bit
|
| 112 |
+
LR scheduler: Cosine
|
| 113 |
+
Weight decay: 0.01
|
| 114 |
+
Precision: BF16
|
| 115 |
+
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
### Training Data
|
| 119 |
+
|
| 120 |
+
The model was fine-tuned on 16,000 instruction-output pairs focused on:
|
| 121 |
+
- Secure coding patterns and practices
|
| 122 |
+
- Web application development (FastAPI, React)
|
| 123 |
+
- Database operations and security
|
| 124 |
+
- Authentication and authorization
|
| 125 |
+
- API design and implementation
|
| 126 |
+
- DevOps and infrastructure configuration
|
| 127 |
+
|
| 128 |
+
**Data composition:**
|
| 129 |
+
- Security-focused coding examples
|
| 130 |
+
- Real-world application patterns
|
| 131 |
+
- Best practice demonstrations
|
| 132 |
+
- Common vulnerability mitigations
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
### Training Loss
|
| 136 |
+
|
| 137 |
+
Final training loss: **0.026**
|
| 138 |
+
|
| 139 |
+
## Usage
|
| 140 |
+
|
| 141 |
+
### Quick Start with Transformers
|
| 142 |
+
|
| 143 |
+
```python
|
| 144 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 145 |
+
import torch
|
| 146 |
+
|
| 147 |
+
# Load model and tokenizer
|
| 148 |
+
model_name = "pki/securitygpt-14b"
|
| 149 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 150 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 151 |
+
model_name,
|
| 152 |
+
torch_dtype=torch.bfloat16,
|
| 153 |
+
device_map="auto",
|
| 154 |
+
trust_remote_code=True
|
| 155 |
+
)
|
| 156 |
+
|
| 157 |
+
# Format prompt with Qwen chat template
|
| 158 |
+
messages = [
|
| 159 |
+
{"role": "system", "content": "You are a helpful AI coding assistant specialized in secure software development."},
|
| 160 |
+
{"role": "user", "content": "Create a FastAPI endpoint for user signup with email and password validation."}
|
| 161 |
+
]
|
| 162 |
+
|
| 163 |
+
text = tokenizer.apply_chat_template(
|
| 164 |
+
messages,
|
| 165 |
+
tokenize=False,
|
| 166 |
+
add_generation_prompt=True
|
| 167 |
+
)
|
| 168 |
+
|
| 169 |
+
# Generate
|
| 170 |
+
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 171 |
+
outputs = model.generate(
|
| 172 |
+
**inputs,
|
| 173 |
+
max_new_tokens=1024,
|
| 174 |
+
temperature=0.4,
|
| 175 |
+
top_p=0.9,
|
| 176 |
+
do_sample=True
|
| 177 |
+
)
|
| 178 |
+
|
| 179 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 180 |
+
print(response)
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
### Using with Ollama (Recommended for Deployment)
|
| 184 |
+
|
| 185 |
+
**Step 1: Convert to GGUF** (if not already converted)
|
| 186 |
+
```bash
|
| 187 |
+
# Convert merged model to GGUF
|
| 188 |
+
python llama.cpp/convert_hf_to_gguf.py merged_model/ \
|
| 189 |
+
--outfile securitygpt-14b-f16.gguf --outtype f16
|
| 190 |
+
|
| 191 |
+
# Quantize for deployment (Q8 recommended)
|
| 192 |
+
llama.cpp/llama-quantize \
|
| 193 |
+
securitygpt-14b-f16.gguf \
|
| 194 |
+
securitygpt-14b-q8.gguf Q8_0
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
**Step 2: Create Modelfile**
|
| 198 |
+
```dockerfile
|
| 199 |
+
FROM ./securitygpt-14b-q8.gguf
|
| 200 |
+
|
| 201 |
+
PARAMETER temperature 0.5
|
| 202 |
+
PARAMETER top_p 0.9
|
| 203 |
+
PARAMETER num_ctx 32768
|
| 204 |
+
PARAMETER stop "<|im_start|>"
|
| 205 |
+
PARAMETER stop "<|im_end|>"
|
| 206 |
+
|
| 207 |
+
TEMPLATE """<|im_start|>system
|
| 208 |
+
You are a helpful AI coding assistant specialized in secure software development.<|im_end|>
|
| 209 |
+
<|im_start|>user
|
| 210 |
+
{{ .Prompt }}<|im_end|>
|
| 211 |
+
<|im_start|>assistant
|
| 212 |
+
"""
|
| 213 |
+
|
| 214 |
+
SYSTEM """You are SecurityGPT, a specialized AI assistant for secure software development. You follow security best practices including: argon2 password hashing, input validation, SQL injection prevention, XSS protection, proper authentication, and comprehensive error handling."""
|
| 215 |
+
```
|
| 216 |
+
|
| 217 |
+
**Step 3: Deploy with Ollama**
|
| 218 |
+
```bash
|
| 219 |
+
ollama create securitygpt:14b -f Modelfile
|
| 220 |
+
ollama run securitygpt:14b
|
| 221 |
+
```
|
| 222 |
+
|
| 223 |
+
### Example Prompts
|
| 224 |
+
|
| 225 |
+
**1. Secure Authentication Endpoint**
|
| 226 |
+
```
|
| 227 |
+
Create a FastAPI endpoint for user login with JWT token generation.
|
| 228 |
+
Use argon2 for password hashing and include proper error handling.
|
| 229 |
+
```
|
| 230 |
+
|
| 231 |
+
**2. React Component with Security**
|
| 232 |
+
```
|
| 233 |
+
Create a React login form component with email validation,
|
| 234 |
+
password strength checking, and CSRF protection.
|
| 235 |
+
```
|
| 236 |
+
|
| 237 |
+
**3. Database Security**
|
| 238 |
+
```
|
| 239 |
+
Write a SQLAlchemy model for user authentication with
|
| 240 |
+
secure password storage and audit logging.
|
| 241 |
+
```
|
| 242 |
+
|
| 243 |
+
**4. API Security Review**
|
| 244 |
+
```
|
| 245 |
+
Review this API endpoint for security vulnerabilities:
|
| 246 |
+
[paste code]
|
| 247 |
+
```
|
| 248 |
+
|
| 249 |
+
## Performance & Benchmarks
|
| 250 |
+
|
| 251 |
+
### Response Quality
|
| 252 |
+
- **Code correctness:** High (generates syntactically correct code)
|
| 253 |
+
- **Security adherence:** Excellent (consistently applies security best practices)
|
| 254 |
+
- **Best practice compliance:** Excellent (follows modern development patterns)
|
| 255 |
+
|
| 256 |
+
|
| 257 |
+
## Limitations & Biases
|
| 258 |
+
|
| 259 |
+
### Known Limitations
|
| 260 |
+
|
| 261 |
+
1. **Domain Specificity**
|
| 262 |
+
- Optimized for web development (FastAPI, React)
|
| 263 |
+
- May be less effective for other domains (embedded systems, game development)
|
| 264 |
+
|
| 265 |
+
2. **Training Data Constraints**
|
| 266 |
+
- Trained on patterns up to knowledge cutoff
|
| 267 |
+
- May not reflect latest framework versions
|
| 268 |
+
- Limited to English language code and documentation
|
| 269 |
+
|
| 270 |
+
3. **Context Length**
|
| 271 |
+
- Maximum 32,768 tokens (though effectively handles ~16-24K for quality)
|
| 272 |
+
- Very large codebases may need chunking
|
| 273 |
+
|
| 274 |
+
4. **Security Limitations**
|
| 275 |
+
- Code generation should ALWAYS be reviewed by humans
|
| 276 |
+
- Not a replacement for professional security audits
|
| 277 |
+
- May not catch all edge cases or vulnerabilities
|
| 278 |
+
|
| 279 |
+
### Potential Biases
|
| 280 |
+
|
| 281 |
+
- **Technology stack bias:** Strong preference for specific tech stack (FastAPI, React, PostgreSQL)
|
| 282 |
+
- **Pattern repetition:** May favor certain code patterns from training data
|
| 283 |
+
- **Verbosity:** Sometimes generates more comprehensive solutions than requested
|
| 284 |
+
|
| 285 |
+
### Mitigation Strategies
|
| 286 |
+
|
| 287 |
+
✅ **Always review generated code** before production use
|
| 288 |
+
✅ **Run security scanners** on generated code
|
| 289 |
+
✅ **Test thoroughly** including edge cases
|
| 290 |
+
✅ **Use alongside** professional security tools
|
| 291 |
+
✅ **Keep dependencies updated** as model may reference older versions
|
| 292 |
+
|
| 293 |
+
## Ethical Considerations
|
| 294 |
+
|
| 295 |
+
### Responsible Use
|
| 296 |
+
|
| 297 |
+
This model should be used responsibly:
|
| 298 |
+
|
| 299 |
+
- ✅ **DO:** Use for learning, prototyping, and accelerating development
|
| 300 |
+
- ✅ **DO:** Review and test all generated code
|
| 301 |
+
- ✅ **DO:** Follow applicable security standards and regulations
|
| 302 |
+
- ⚠️ **DON'T:** Use for malicious purposes or exploit development
|
| 303 |
+
- ⚠️ **DON'T:** Deploy generated code without human review
|
| 304 |
+
- ⚠️ **DON'T:** Rely solely on AI for security-critical systems
|
| 305 |
+
|
| 306 |
+
### Environmental Impact
|
| 307 |
+
|
| 308 |
+
- **Inference efficiency:** QLoRA and quantization reduce deployment costs
|
| 309 |
+
- **Optimization:** Unsloth reduces training time and energy consumption
|
| 310 |
+
|
| 311 |
+
## Citation
|
| 312 |
+
|
| 313 |
+
If you use SecurityGPT in your research or projects, please cite:
|
| 314 |
+
|
| 315 |
+
```bibtex
|
| 316 |
+
@misc{securitygpt2026,
|
| 317 |
+
title={SecurityGPT: A Security-Focused Code Generation Model},
|
| 318 |
+
author={[email protected]},
|
| 319 |
+
year={2026},
|
| 320 |
+
publisher={Hugging Face},
|
| 321 |
+
howpublished={\url{https://huggingface.co/pki/securitygpt-14b}},
|
| 322 |
+
note={Fine-tuned from Qwen2.5-Coder-14B-Instruct}
|
| 323 |
+
}
|
| 324 |
+
```
|
| 325 |
+
|
| 326 |
+
**Base model citation:**
|
| 327 |
+
```bibtex
|
| 328 |
+
@article{qwen2.5,
|
| 329 |
+
title={Qwen2.5-Coder Technical Report},
|
| 330 |
+
author={Qwen Team},
|
| 331 |
+
journal={arXiv preprint},
|
| 332 |
+
year={2024}
|
| 333 |
+
}
|
| 334 |
+
```
|
| 335 |
+
|
| 336 |
+
## Model Card Contact
|
| 337 |
+
|
| 338 |
+
For questions, issues, or collaboration:
|
| 339 |
+
- **Issues:** Open an issue on the model repository
|
| 340 |
+
- **Discussions:** Use Hugging Face discussions tab
|
| 341 |
+
- **Email:** Contact through Hugging Face profile
|
| 342 |
+
|
| 343 |
+
## Changelog
|
| 344 |
+
|
| 345 |
+
### v1.0.0 (2025-12)
|
| 346 |
+
- Initial release
|
| 347 |
+
- Fine-tuned on 16,000 security-focused examples
|
| 348 |
+
- Supports 32K context window
|
| 349 |
+
- Optimized for FastAPI, React, and security best practices
|
| 350 |
+
|
| 351 |
+
## Acknowledgments
|
| 352 |
+
|
| 353 |
+
- **Base model:** [Qwen Team](https://huggingface.co/Qwen) for Qwen2.5-Coder-14B-Instruct
|
| 354 |
+
- **Training framework:** [Unsloth AI](https://github.com/unslothai/unsloth) for optimization
|
| 355 |
+
- **Quantization:** [llama.cpp](https://github.com/ggerganov/llama.cpp) for GGUF conversion
|
| 356 |
+
- **Deployment:** [Ollama](https://ollama.ai) for inference serving
|
| 357 |
+
|
| 358 |
+
## License
|
| 359 |
+
|
| 360 |
+
This model is released under the **Apache 2.0 License**, same as the base Qwen2.5-Coder model.
|
| 361 |
+
|
| 362 |
+
```
|
| 363 |
+
|
| 364 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 365 |
+
you may not use this file except in compliance with the License.
|
| 366 |
+
You may obtain a copy of the License at
|
| 367 |
+
|
| 368 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 369 |
+
|
| 370 |
+
Unless required by applicable law or agreed to in writing, software
|
| 371 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 372 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 373 |
+
See the License for the specific language governing permissions and
|
| 374 |
+
limitations under the License.
|
| 375 |
+
```
|
| 376 |
+
|
| 377 |
+
---
|
| 378 |
+
|
| 379 |
+
**Disclaimer:** This model is provided as-is for research and development purposes. Always review and test generated code before production deployment. The authors are not responsible for any damages resulting from the use of this model.
|
USAGE_EXAMPLES.md
ADDED
|
@@ -0,0 +1,657 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SecurityGPT Usage Examples
|
| 2 |
+
|
| 3 |
+
Practical examples for using SecurityGPT in various development scenarios.
|
| 4 |
+
|
| 5 |
+
## Table of Contents
|
| 6 |
+
|
| 7 |
+
1. [Basic Usage](#basic-usage)
|
| 8 |
+
2. [Secure API Development](#secure-api-development)
|
| 9 |
+
3. [Frontend Development](#frontend-development)
|
| 10 |
+
4. [Database Operations](#database-operations)
|
| 11 |
+
5. [Security Reviews](#security-reviews)
|
| 12 |
+
6. [DevOps & Infrastructure](#devops--infrastructure)
|
| 13 |
+
7. [Advanced Patterns](#advanced-patterns)
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## Basic Usage
|
| 18 |
+
|
| 19 |
+
### Example 1: Simple Code Generation
|
| 20 |
+
|
| 21 |
+
```python
|
| 22 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 23 |
+
|
| 24 |
+
model_name = "pki/securitygpt-14b"
|
| 25 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 26 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 27 |
+
model_name,
|
| 28 |
+
device_map="auto",
|
| 29 |
+
trust_remote_code=True
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
# Simple prompt
|
| 33 |
+
prompt = "Write a Python function to validate email addresses using regex"
|
| 34 |
+
|
| 35 |
+
messages = [
|
| 36 |
+
{"role": "system", "content": "You are a helpful coding assistant."},
|
| 37 |
+
{"role": "user", "content": prompt}
|
| 38 |
+
]
|
| 39 |
+
|
| 40 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 41 |
+
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 42 |
+
|
| 43 |
+
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
|
| 44 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 45 |
+
print(response)
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
### Example 2: Using Ollama CLI
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
# Simple query
|
| 52 |
+
ollama run securitygpt:14b "Create a FastAPI health check endpoint"
|
| 53 |
+
|
| 54 |
+
# With context
|
| 55 |
+
ollama run securitygpt:14b "Create a user authentication endpoint with JWT tokens and argon2 password hashing"
|
| 56 |
+
|
| 57 |
+
# Code review
|
| 58 |
+
ollama run securitygpt:14b "Review this code for security issues: $(cat auth.py)"
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## Secure API Development
|
| 64 |
+
|
| 65 |
+
### Example 3: FastAPI User Authentication
|
| 66 |
+
|
| 67 |
+
**Prompt:**
|
| 68 |
+
```
|
| 69 |
+
Create a complete FastAPI authentication system with:
|
| 70 |
+
- User signup endpoint with email validation
|
| 71 |
+
- Login endpoint with JWT token generation
|
| 72 |
+
- Password hashing using argon2
|
| 73 |
+
- Proper error handling
|
| 74 |
+
- Input validation using Pydantic
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
**Expected Output Pattern:**
|
| 78 |
+
```python
|
| 79 |
+
from fastapi import APIRouter, HTTPException, Depends
|
| 80 |
+
from pydantic import BaseModel, EmailStr, Field
|
| 81 |
+
from passlib.context import CryptContext
|
| 82 |
+
from datetime import datetime, timedelta
|
| 83 |
+
import jwt
|
| 84 |
+
|
| 85 |
+
router = APIRouter(prefix="/api/v1/auth", tags=["authentication"])
|
| 86 |
+
|
| 87 |
+
# Password hashing with argon2 (NEVER bcrypt)
|
| 88 |
+
pwd_context = CryptContext(schemes=["argon2"], deprecated="auto")
|
| 89 |
+
|
| 90 |
+
class UserSignup(BaseModel):
|
| 91 |
+
email: EmailStr
|
| 92 |
+
password: str = Field(..., min_length=8)
|
| 93 |
+
full_name: str = Field(..., min_length=2)
|
| 94 |
+
|
| 95 |
+
class UserLogin(BaseModel):
|
| 96 |
+
email: EmailStr
|
| 97 |
+
password: str
|
| 98 |
+
|
| 99 |
+
@router.post("/signup")
|
| 100 |
+
async def signup(user: UserSignup):
|
| 101 |
+
"""Create new user with secure password hashing."""
|
| 102 |
+
# Validate password strength
|
| 103 |
+
if len(user.password) < 8:
|
| 104 |
+
raise HTTPException(400, "Password must be at least 8 characters")
|
| 105 |
+
|
| 106 |
+
# Hash password with argon2
|
| 107 |
+
hashed_password = pwd_context.hash(user.password)
|
| 108 |
+
|
| 109 |
+
# Store user in database
|
| 110 |
+
# ... (database logic)
|
| 111 |
+
|
| 112 |
+
return {"message": "User created successfully"}
|
| 113 |
+
|
| 114 |
+
@router.post("/login")
|
| 115 |
+
async def login(credentials: UserLogin):
|
| 116 |
+
"""Authenticate user and return JWT token."""
|
| 117 |
+
# Get user from database
|
| 118 |
+
# user = get_user_by_email(credentials.email)
|
| 119 |
+
|
| 120 |
+
# Verify password
|
| 121 |
+
if not pwd_context.verify(credentials.password, user.hashed_password):
|
| 122 |
+
raise HTTPException(401, "Invalid credentials")
|
| 123 |
+
|
| 124 |
+
# Generate JWT token
|
| 125 |
+
token_data = {
|
| 126 |
+
"sub": user.email,
|
| 127 |
+
"exp": datetime.utcnow() + timedelta(hours=24)
|
| 128 |
+
}
|
| 129 |
+
token = jwt.encode(token_data, SECRET_KEY, algorithm="HS256")
|
| 130 |
+
|
| 131 |
+
return {"access_token": token, "token_type": "bearer"}
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
### Example 4: API with Input Validation
|
| 135 |
+
|
| 136 |
+
**Prompt:**
|
| 137 |
+
```
|
| 138 |
+
Create a FastAPI endpoint for creating blog posts with:
|
| 139 |
+
- Title validation (max 200 chars)
|
| 140 |
+
- Content validation
|
| 141 |
+
- Tag validation (max 5 tags)
|
| 142 |
+
- SQL injection prevention
|
| 143 |
+
- Proper error responses
|
| 144 |
+
```
|
| 145 |
+
|
| 146 |
+
---
|
| 147 |
+
|
| 148 |
+
## Frontend Development
|
| 149 |
+
|
| 150 |
+
### Example 5: Secure React Login Form
|
| 151 |
+
|
| 152 |
+
**Prompt:**
|
| 153 |
+
```
|
| 154 |
+
Create a React login component with:
|
| 155 |
+
- Email and password inputs
|
| 156 |
+
- Client-side validation
|
| 157 |
+
- XSS protection
|
| 158 |
+
- CSRF token handling
|
| 159 |
+
- Loading states
|
| 160 |
+
- Error display
|
| 161 |
+
- TypeScript types
|
| 162 |
+
```
|
| 163 |
+
|
| 164 |
+
**Expected Output Pattern:**
|
| 165 |
+
```typescript
|
| 166 |
+
import React, { useState } from 'react';
|
| 167 |
+
import DOMPurify from 'dompurify';
|
| 168 |
+
|
| 169 |
+
interface LoginFormProps {
|
| 170 |
+
onSubmit: (email: string, password: string) => Promise<void>;
|
| 171 |
+
csrfToken: string;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
interface FormErrors {
|
| 175 |
+
email?: string;
|
| 176 |
+
password?: string;
|
| 177 |
+
general?: string;
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
export const LoginForm: React.FC<LoginFormProps> = ({ onSubmit, csrfToken }) => {
|
| 181 |
+
const [email, setEmail] = useState('');
|
| 182 |
+
const [password, setPassword] = useState('');
|
| 183 |
+
const [errors, setErrors] = useState<FormErrors>({});
|
| 184 |
+
const [loading, setLoading] = useState(false);
|
| 185 |
+
|
| 186 |
+
const validateEmail = (email: string): boolean => {
|
| 187 |
+
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
| 188 |
+
return regex.test(email);
|
| 189 |
+
};
|
| 190 |
+
|
| 191 |
+
const handleSubmit = async (e: React.FormEvent) => {
|
| 192 |
+
e.preventDefault();
|
| 193 |
+
|
| 194 |
+
// Clear previous errors
|
| 195 |
+
setErrors({});
|
| 196 |
+
|
| 197 |
+
// Validate inputs
|
| 198 |
+
const newErrors: FormErrors = {};
|
| 199 |
+
|
| 200 |
+
if (!validateEmail(email)) {
|
| 201 |
+
newErrors.email = 'Invalid email address';
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
if (password.length < 8) {
|
| 205 |
+
newErrors.password = 'Password must be at least 8 characters';
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
if (Object.keys(newErrors).length > 0) {
|
| 209 |
+
setErrors(newErrors);
|
| 210 |
+
return;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
// Sanitize inputs (XSS protection)
|
| 214 |
+
const cleanEmail = DOMPurify.sanitize(email);
|
| 215 |
+
|
| 216 |
+
try {
|
| 217 |
+
setLoading(true);
|
| 218 |
+
await onSubmit(cleanEmail, password);
|
| 219 |
+
} catch (error) {
|
| 220 |
+
setErrors({ general: 'Login failed. Please try again.' });
|
| 221 |
+
} finally {
|
| 222 |
+
setLoading(false);
|
| 223 |
+
}
|
| 224 |
+
};
|
| 225 |
+
|
| 226 |
+
return (
|
| 227 |
+
<form onSubmit={handleSubmit}>
|
| 228 |
+
<input type="hidden" name="csrf_token" value={csrfToken} />
|
| 229 |
+
|
| 230 |
+
<div>
|
| 231 |
+
<label htmlFor="email">Email</label>
|
| 232 |
+
<input
|
| 233 |
+
id="email"
|
| 234 |
+
type="email"
|
| 235 |
+
value={email}
|
| 236 |
+
onChange={(e) => setEmail(e.target.value)}
|
| 237 |
+
disabled={loading}
|
| 238 |
+
required
|
| 239 |
+
/>
|
| 240 |
+
{errors.email && <span className="error">{errors.email}</span>}
|
| 241 |
+
</div>
|
| 242 |
+
|
| 243 |
+
<div>
|
| 244 |
+
<label htmlFor="password">Password</label>
|
| 245 |
+
<input
|
| 246 |
+
id="password"
|
| 247 |
+
type="password"
|
| 248 |
+
value={password}
|
| 249 |
+
onChange={(e) => setPassword(e.target.value)}
|
| 250 |
+
disabled={loading}
|
| 251 |
+
required
|
| 252 |
+
/>
|
| 253 |
+
{errors.password && <span className="error">{errors.password}</span>}
|
| 254 |
+
</div>
|
| 255 |
+
|
| 256 |
+
{errors.general && <div className="error">{errors.general}</div>}
|
| 257 |
+
|
| 258 |
+
<button type="submit" disabled={loading}>
|
| 259 |
+
{loading ? 'Logging in...' : 'Login'}
|
| 260 |
+
</button>
|
| 261 |
+
</form>
|
| 262 |
+
);
|
| 263 |
+
};
|
| 264 |
+
```
|
| 265 |
+
|
| 266 |
+
### Example 6: API Client with Error Handling
|
| 267 |
+
|
| 268 |
+
**Prompt:**
|
| 269 |
+
```
|
| 270 |
+
Create a TypeScript API client class with:
|
| 271 |
+
- Axios integration
|
| 272 |
+
- JWT token management
|
| 273 |
+
- Request interceptors
|
| 274 |
+
- Error handling
|
| 275 |
+
- Retry logic
|
| 276 |
+
- Type safety
|
| 277 |
+
```
|
| 278 |
+
|
| 279 |
+
---
|
| 280 |
+
|
| 281 |
+
## Database Operations
|
| 282 |
+
|
| 283 |
+
### Example 7: Secure SQLAlchemy Model
|
| 284 |
+
|
| 285 |
+
**Prompt:**
|
| 286 |
+
```
|
| 287 |
+
Create a SQLAlchemy User model with:
|
| 288 |
+
- Secure password storage
|
| 289 |
+
- Email uniqueness constraint
|
| 290 |
+
- Timestamps (created_at, updated_at)
|
| 291 |
+
- Soft delete support
|
| 292 |
+
- Audit logging
|
| 293 |
+
```
|
| 294 |
+
|
| 295 |
+
**Expected Output:**
|
| 296 |
+
```python
|
| 297 |
+
from sqlalchemy import Column, Integer, String, DateTime, Boolean
|
| 298 |
+
from sqlalchemy.ext.declarative import declarative_base
|
| 299 |
+
from datetime import datetime
|
| 300 |
+
from passlib.context import CryptContext
|
| 301 |
+
|
| 302 |
+
Base = declarative_base()
|
| 303 |
+
pwd_context = CryptContext(schemes=["argon2"], deprecated="auto")
|
| 304 |
+
|
| 305 |
+
class User(Base):
|
| 306 |
+
__tablename__ = "users"
|
| 307 |
+
|
| 308 |
+
id = Column(Integer, primary_key=True, index=True)
|
| 309 |
+
email = Column(String(255), unique=True, index=True, nullable=False)
|
| 310 |
+
hashed_password = Column(String(255), nullable=False)
|
| 311 |
+
full_name = Column(String(255))
|
| 312 |
+
is_active = Column(Boolean, default=True)
|
| 313 |
+
is_deleted = Column(Boolean, default=False)
|
| 314 |
+
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
|
| 315 |
+
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
| 316 |
+
|
| 317 |
+
def set_password(self, password: str):
|
| 318 |
+
"""Hash and set user password using argon2."""
|
| 319 |
+
self.hashed_password = pwd_context.hash(password)
|
| 320 |
+
|
| 321 |
+
def verify_password(self, password: str) -> bool:
|
| 322 |
+
"""Verify password against stored hash."""
|
| 323 |
+
return pwd_context.verify(password, self.hashed_password)
|
| 324 |
+
|
| 325 |
+
def soft_delete(self):
|
| 326 |
+
"""Mark user as deleted without removing from database."""
|
| 327 |
+
self.is_deleted = True
|
| 328 |
+
self.is_active = False
|
| 329 |
+
```
|
| 330 |
+
|
| 331 |
+
### Example 8: Database Migration
|
| 332 |
+
|
| 333 |
+
**Prompt:**
|
| 334 |
+
```
|
| 335 |
+
Create an Alembic migration script to add user authentication table with proper indexes
|
| 336 |
+
```
|
| 337 |
+
|
| 338 |
+
---
|
| 339 |
+
|
| 340 |
+
## Security Reviews
|
| 341 |
+
|
| 342 |
+
### Example 9: Code Security Audit
|
| 343 |
+
|
| 344 |
+
**Prompt:**
|
| 345 |
+
```
|
| 346 |
+
Review this authentication code for security vulnerabilities:
|
| 347 |
+
|
| 348 |
+
def login(username, password):
|
| 349 |
+
query = f"SELECT * FROM users WHERE username='{username}' AND password='{password}'"
|
| 350 |
+
result = db.execute(query)
|
| 351 |
+
if result:
|
| 352 |
+
return create_token(username)
|
| 353 |
+
return None
|
| 354 |
+
```
|
| 355 |
+
|
| 356 |
+
**Expected Output:**
|
| 357 |
+
```
|
| 358 |
+
SECURITY VULNERABILITIES FOUND:
|
| 359 |
+
|
| 360 |
+
1. SQL INJECTION (CRITICAL)
|
| 361 |
+
- Line 2: Raw string concatenation in SQL query
|
| 362 |
+
- Attack vector: username = "admin' OR '1'='1"
|
| 363 |
+
- Fix: Use parameterized queries or ORM
|
| 364 |
+
|
| 365 |
+
2. PLAINTEXT PASSWORDS (CRITICAL)
|
| 366 |
+
- Line 2: Password stored/compared in plaintext
|
| 367 |
+
- Fix: Use argon2 password hashing
|
| 368 |
+
|
| 369 |
+
3. TIMING ATTACK (MEDIUM)
|
| 370 |
+
- Different execution paths for valid/invalid users
|
| 371 |
+
- Fix: Use constant-time comparison
|
| 372 |
+
|
| 373 |
+
SECURE IMPLEMENTATION:
|
| 374 |
+
|
| 375 |
+
from sqlalchemy.orm import Session
|
| 376 |
+
from passlib.context import CryptContext
|
| 377 |
+
|
| 378 |
+
pwd_context = CryptContext(schemes=["argon2"], deprecated="auto")
|
| 379 |
+
|
| 380 |
+
def login(username: str, password: str, db: Session):
|
| 381 |
+
"""Secure login with parameterized query and password hashing."""
|
| 382 |
+
# Parameterized query (SQL injection prevention)
|
| 383 |
+
user = db.query(User).filter(User.username == username).first()
|
| 384 |
+
|
| 385 |
+
# Constant-time check to prevent timing attacks
|
| 386 |
+
if user is None:
|
| 387 |
+
# Perform dummy hash to maintain constant time
|
| 388 |
+
pwd_context.hash("dummy")
|
| 389 |
+
return None
|
| 390 |
+
|
| 391 |
+
# Verify password with argon2
|
| 392 |
+
if not pwd_context.verify(password, user.hashed_password):
|
| 393 |
+
return None
|
| 394 |
+
|
| 395 |
+
return create_token(user.id)
|
| 396 |
+
```
|
| 397 |
+
|
| 398 |
+
---
|
| 399 |
+
|
| 400 |
+
## DevOps & Infrastructure
|
| 401 |
+
|
| 402 |
+
### Example 10: Docker Compose with Security
|
| 403 |
+
|
| 404 |
+
**Prompt:**
|
| 405 |
+
```
|
| 406 |
+
Create a secure docker-compose.yml for a FastAPI app with PostgreSQL including:
|
| 407 |
+
- Non-root users
|
| 408 |
+
- Environment variables from secrets
|
| 409 |
+
- Network isolation
|
| 410 |
+
- Health checks
|
| 411 |
+
- Resource limits
|
| 412 |
+
```
|
| 413 |
+
|
| 414 |
+
### Example 11: GitLab CI/CD Pipeline
|
| 415 |
+
|
| 416 |
+
**Prompt:**
|
| 417 |
+
```
|
| 418 |
+
Create a GitLab CI pipeline for a Python FastAPI app with:
|
| 419 |
+
- Linting (flake8)
|
| 420 |
+
- Testing (pytest)
|
| 421 |
+
- Security scanning
|
| 422 |
+
- Docker build
|
| 423 |
+
- Deployment to production
|
| 424 |
+
```
|
| 425 |
+
|
| 426 |
+
---
|
| 427 |
+
|
| 428 |
+
## Advanced Patterns
|
| 429 |
+
|
| 430 |
+
### Example 12: Rate Limiting Middleware
|
| 431 |
+
|
| 432 |
+
**Prompt:**
|
| 433 |
+
```
|
| 434 |
+
Create FastAPI rate limiting middleware using Redis with:
|
| 435 |
+
- IP-based limiting
|
| 436 |
+
- Token bucket algorithm
|
| 437 |
+
- Configurable limits
|
| 438 |
+
- Custom error responses
|
| 439 |
+
```
|
| 440 |
+
|
| 441 |
+
### Example 13: API Key Management
|
| 442 |
+
|
| 443 |
+
**Prompt:**
|
| 444 |
+
```
|
| 445 |
+
Create an API key management system with:
|
| 446 |
+
- Key generation with secure random
|
| 447 |
+
- Key hashing for storage
|
| 448 |
+
- Rate limiting per key
|
| 449 |
+
- Key expiration
|
| 450 |
+
- Usage tracking
|
| 451 |
+
```
|
| 452 |
+
|
| 453 |
+
### Example 14: Multi-factor Authentication
|
| 454 |
+
|
| 455 |
+
**Prompt:**
|
| 456 |
+
```
|
| 457 |
+
Implement TOTP-based 2FA for FastAPI with:
|
| 458 |
+
- QR code generation
|
| 459 |
+
- Token verification
|
| 460 |
+
- Backup codes
|
| 461 |
+
- Account recovery
|
| 462 |
+
```
|
| 463 |
+
|
| 464 |
+
---
|
| 465 |
+
|
| 466 |
+
## Integration Examples
|
| 467 |
+
|
| 468 |
+
### Example 15: Using with LangChain
|
| 469 |
+
|
| 470 |
+
```python
|
| 471 |
+
from langchain.llms import HuggingFacePipeline
|
| 472 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
| 473 |
+
|
| 474 |
+
model_name = "pki/securitygpt-14b"
|
| 475 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 476 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 477 |
+
model_name,
|
| 478 |
+
device_map="auto",
|
| 479 |
+
trust_remote_code=True
|
| 480 |
+
)
|
| 481 |
+
|
| 482 |
+
pipe = pipeline(
|
| 483 |
+
"text-generation",
|
| 484 |
+
model=model,
|
| 485 |
+
tokenizer=tokenizer,
|
| 486 |
+
max_new_tokens=1024,
|
| 487 |
+
temperature=0.7
|
| 488 |
+
)
|
| 489 |
+
|
| 490 |
+
llm = HuggingFacePipeline(pipeline=pipe)
|
| 491 |
+
|
| 492 |
+
# Use with LangChain
|
| 493 |
+
from langchain.chains import LLMChain
|
| 494 |
+
from langchain.prompts import PromptTemplate
|
| 495 |
+
|
| 496 |
+
template = """Create a secure {feature} for a {framework} application.
|
| 497 |
+
Include proper error handling and security best practices.
|
| 498 |
+
|
| 499 |
+
Feature: {feature}
|
| 500 |
+
Framework: {framework}
|
| 501 |
+
"""
|
| 502 |
+
|
| 503 |
+
prompt = PromptTemplate(template=template, input_variables=["feature", "framework"])
|
| 504 |
+
chain = LLMChain(llm=llm, prompt=prompt)
|
| 505 |
+
|
| 506 |
+
result = chain.run(feature="user authentication", framework="FastAPI")
|
| 507 |
+
print(result)
|
| 508 |
+
```
|
| 509 |
+
|
| 510 |
+
### Example 16: Batch Processing
|
| 511 |
+
|
| 512 |
+
```python
|
| 513 |
+
# Process multiple code generation tasks
|
| 514 |
+
prompts = [
|
| 515 |
+
"Create a FastAPI endpoint for user registration",
|
| 516 |
+
"Create a React form component for login",
|
| 517 |
+
"Create a PostgreSQL schema for user management"
|
| 518 |
+
]
|
| 519 |
+
|
| 520 |
+
for prompt in prompts:
|
| 521 |
+
messages = [
|
| 522 |
+
{"role": "system", "content": "You are a secure coding assistant."},
|
| 523 |
+
{"role": "user", "content": prompt}
|
| 524 |
+
]
|
| 525 |
+
|
| 526 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 527 |
+
inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 528 |
+
|
| 529 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 530 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 531 |
+
|
| 532 |
+
print(f"\n{'='*60}\nPrompt: {prompt}\n{'='*60}")
|
| 533 |
+
print(response)
|
| 534 |
+
```
|
| 535 |
+
|
| 536 |
+
---
|
| 537 |
+
|
| 538 |
+
## Tips for Best Results
|
| 539 |
+
|
| 540 |
+
### 1. Be Specific in Prompts
|
| 541 |
+
|
| 542 |
+
❌ Bad: "Create an API endpoint"
|
| 543 |
+
✅ Good: "Create a FastAPI POST endpoint at /api/v1/users for user registration with email validation and argon2 password hashing"
|
| 544 |
+
|
| 545 |
+
### 2. Specify Technology Stack
|
| 546 |
+
|
| 547 |
+
Include framework versions and specific libraries when relevant:
|
| 548 |
+
```
|
| 549 |
+
Create a React 18 component using TypeScript and Tailwind CSS for...
|
| 550 |
+
```
|
| 551 |
+
|
| 552 |
+
### 3. Request Security Features
|
| 553 |
+
|
| 554 |
+
Explicitly ask for security features:
|
| 555 |
+
```
|
| 556 |
+
Create a login endpoint with argon2 password hashing, rate limiting, and CSRF protection
|
| 557 |
+
```
|
| 558 |
+
|
| 559 |
+
### 4. Use System Prompts
|
| 560 |
+
|
| 561 |
+
Customize the system prompt for your use case:
|
| 562 |
+
```python
|
| 563 |
+
messages = [
|
| 564 |
+
{"role": "system", "content": "You are a senior security engineer reviewing code for vulnerabilities."},
|
| 565 |
+
{"role": "user", "content": "Review this authentication code..."}
|
| 566 |
+
]
|
| 567 |
+
```
|
| 568 |
+
|
| 569 |
+
### 5. Adjust Temperature
|
| 570 |
+
|
| 571 |
+
- **Low (0.1-0.3):** Deterministic, consistent code generation
|
| 572 |
+
- **Medium (0.5-0.7):** Balanced creativity and consistency
|
| 573 |
+
- **High (0.8-1.0):** More creative solutions, less predictable
|
| 574 |
+
|
| 575 |
+
### 6. Iterate and Refine
|
| 576 |
+
|
| 577 |
+
Use follow-up prompts to refine output:
|
| 578 |
+
```
|
| 579 |
+
1st prompt: "Create a user authentication endpoint"
|
| 580 |
+
2nd prompt: "Add rate limiting to prevent brute force attacks"
|
| 581 |
+
3rd prompt: "Add logging for security audit trail"
|
| 582 |
+
```
|
| 583 |
+
|
| 584 |
+
---
|
| 585 |
+
|
| 586 |
+
## Common Patterns
|
| 587 |
+
|
| 588 |
+
### Pattern 1: Full-Stack Feature
|
| 589 |
+
|
| 590 |
+
```
|
| 591 |
+
Create a complete user profile feature including:
|
| 592 |
+
- Backend: FastAPI endpoint with SQLAlchemy model
|
| 593 |
+
- Frontend: React component with TypeScript
|
| 594 |
+
- Database: PostgreSQL migration script
|
| 595 |
+
- Tests: pytest for backend, Jest for frontend
|
| 596 |
+
```
|
| 597 |
+
|
| 598 |
+
### Pattern 2: Security Hardening
|
| 599 |
+
|
| 600 |
+
```
|
| 601 |
+
Review and harden this [component] for production:
|
| 602 |
+
- Add input validation
|
| 603 |
+
- Implement rate limiting
|
| 604 |
+
- Add security headers
|
| 605 |
+
- Add audit logging
|
| 606 |
+
- Fix any SQL injection or XSS vulnerabilities
|
| 607 |
+
```
|
| 608 |
+
|
| 609 |
+
### Pattern 3: Migration/Upgrade
|
| 610 |
+
|
| 611 |
+
```
|
| 612 |
+
Migrate this Flask endpoint to FastAPI:
|
| 613 |
+
- Use Pydantic for validation
|
| 614 |
+
- Add async/await
|
| 615 |
+
- Update to /api/v1 versioning
|
| 616 |
+
- Add OpenAPI documentation
|
| 617 |
+
[paste code]
|
| 618 |
+
```
|
| 619 |
+
|
| 620 |
+
---
|
| 621 |
+
|
| 622 |
+
## Troubleshooting
|
| 623 |
+
|
| 624 |
+
### Issue: Model generating outdated patterns
|
| 625 |
+
|
| 626 |
+
**Solution:** Explicitly specify modern versions in prompt
|
| 627 |
+
```
|
| 628 |
+
Create a FastAPI endpoint using FastAPI 0.110+ with Pydantic v2
|
| 629 |
+
```
|
| 630 |
+
|
| 631 |
+
### Issue: Output too verbose
|
| 632 |
+
|
| 633 |
+
**Solution:** Lower temperature and add conciseness requirement
|
| 634 |
+
```python
|
| 635 |
+
outputs = model.generate(..., temperature=0.3)
|
| 636 |
+
# Add to prompt: "Provide concise implementation without extensive comments"
|
| 637 |
+
```
|
| 638 |
+
|
| 639 |
+
### Issue: Missing security features
|
| 640 |
+
|
| 641 |
+
**Solution:** Explicitly list required security features in prompt
|
| 642 |
+
```
|
| 643 |
+
Include: input validation, SQL injection prevention, XSS protection, rate limiting
|
| 644 |
+
```
|
| 645 |
+
|
| 646 |
+
---
|
| 647 |
+
|
| 648 |
+
## Additional Resources
|
| 649 |
+
|
| 650 |
+
- [Model Card](./MODEL_CARD.md) - Full model documentation
|
| 651 |
+
- [Training Details](./TRAINING.md) - Training methodology
|
| 652 |
+
- [Deployment Guide](./DEPLOYMENT.md) - Production deployment
|
| 653 |
+
- [Hugging Face Model Hub](https://huggingface.co/pki/securitygpt-14b)
|
| 654 |
+
|
| 655 |
+
---
|
| 656 |
+
|
| 657 |
+
**Need help?** Open an issue on the model repository or use the Hugging Face discussions tab.
|
added_tokens.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"</tool_call>": 151658,
|
| 3 |
+
"<tool_call>": 151657,
|
| 4 |
+
"<|box_end|>": 151649,
|
| 5 |
+
"<|box_start|>": 151648,
|
| 6 |
+
"<|endoftext|>": 151643,
|
| 7 |
+
"<|file_sep|>": 151664,
|
| 8 |
+
"<|fim_middle|>": 151660,
|
| 9 |
+
"<|fim_pad|>": 151662,
|
| 10 |
+
"<|fim_prefix|>": 151659,
|
| 11 |
+
"<|fim_suffix|>": 151661,
|
| 12 |
+
"<|im_end|>": 151645,
|
| 13 |
+
"<|im_start|>": 151644,
|
| 14 |
+
"<|image_pad|>": 151655,
|
| 15 |
+
"<|object_ref_end|>": 151647,
|
| 16 |
+
"<|object_ref_start|>": 151646,
|
| 17 |
+
"<|quad_end|>": 151651,
|
| 18 |
+
"<|quad_start|>": 151650,
|
| 19 |
+
"<|repo_name|>": 151663,
|
| 20 |
+
"<|video_pad|>": 151656,
|
| 21 |
+
"<|vision_end|>": 151653,
|
| 22 |
+
"<|vision_pad|>": 151654,
|
| 23 |
+
"<|vision_start|>": 151652
|
| 24 |
+
}
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 4 |
+
{{- messages[0]['content'] }}
|
| 5 |
+
{%- else %}
|
| 6 |
+
{{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
|
| 7 |
+
{%- endif %}
|
| 8 |
+
{{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 9 |
+
{%- for tool in tools %}
|
| 10 |
+
{{- "\n" }}
|
| 11 |
+
{{- tool | tojson }}
|
| 12 |
+
{%- endfor %}
|
| 13 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 14 |
+
{%- else %}
|
| 15 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 16 |
+
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 17 |
+
{%- else %}
|
| 18 |
+
{{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
|
| 19 |
+
{%- endif %}
|
| 20 |
+
{%- endif %}
|
| 21 |
+
{%- for message in messages %}
|
| 22 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
|
| 23 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 24 |
+
{%- elif message.role == "assistant" %}
|
| 25 |
+
{{- '<|im_start|>' + message.role }}
|
| 26 |
+
{%- if message.content %}
|
| 27 |
+
{{- '\n' + message.content }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{%- for tool_call in message.tool_calls %}
|
| 30 |
+
{%- if tool_call.function is defined %}
|
| 31 |
+
{%- set tool_call = tool_call.function %}
|
| 32 |
+
{%- endif %}
|
| 33 |
+
{{- '\n<tool_call>\n{"name": "' }}
|
| 34 |
+
{{- tool_call.name }}
|
| 35 |
+
{{- '", "arguments": ' }}
|
| 36 |
+
{{- tool_call.arguments | tojson }}
|
| 37 |
+
{{- '}\n</tool_call>' }}
|
| 38 |
+
{%- endfor %}
|
| 39 |
+
{{- '<|im_end|>\n' }}
|
| 40 |
+
{%- elif message.role == "tool" %}
|
| 41 |
+
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
|
| 42 |
+
{{- '<|im_start|>user' }}
|
| 43 |
+
{%- endif %}
|
| 44 |
+
{{- '\n<tool_response>\n' }}
|
| 45 |
+
{{- message.content }}
|
| 46 |
+
{{- '\n</tool_response>' }}
|
| 47 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 48 |
+
{{- '<|im_end|>\n' }}
|
| 49 |
+
{%- endif %}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
{%- if add_generation_prompt %}
|
| 53 |
+
{{- '<|im_start|>assistant\n' }}
|
| 54 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"torch_dtype": "bfloat16",
|
| 7 |
+
"eos_token_id": 151645,
|
| 8 |
+
"hidden_act": "silu",
|
| 9 |
+
"hidden_size": 5120,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 13824,
|
| 12 |
+
"layer_types": [
|
| 13 |
+
"full_attention",
|
| 14 |
+
"full_attention",
|
| 15 |
+
"full_attention",
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"full_attention",
|
| 51 |
+
"full_attention",
|
| 52 |
+
"full_attention",
|
| 53 |
+
"full_attention",
|
| 54 |
+
"full_attention",
|
| 55 |
+
"full_attention",
|
| 56 |
+
"full_attention",
|
| 57 |
+
"full_attention",
|
| 58 |
+
"full_attention",
|
| 59 |
+
"full_attention",
|
| 60 |
+
"full_attention"
|
| 61 |
+
],
|
| 62 |
+
"max_position_embeddings": 32768,
|
| 63 |
+
"max_window_layers": 70,
|
| 64 |
+
"model_type": "qwen2",
|
| 65 |
+
"num_attention_heads": 40,
|
| 66 |
+
"num_hidden_layers": 48,
|
| 67 |
+
"num_key_value_heads": 8,
|
| 68 |
+
"pad_token_id": 151654,
|
| 69 |
+
"rms_norm_eps": 1e-06,
|
| 70 |
+
"rope_scaling": null,
|
| 71 |
+
"rope_theta": 1000000.0,
|
| 72 |
+
"sliding_window": null,
|
| 73 |
+
"tie_word_embeddings": false,
|
| 74 |
+
"transformers_version": "4.57.3",
|
| 75 |
+
"unsloth_fixed": true,
|
| 76 |
+
"unsloth_version": "2025.12.4",
|
| 77 |
+
"use_cache": true,
|
| 78 |
+
"use_sliding_window": false,
|
| 79 |
+
"vocab_size": 152064
|
| 80 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": null,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": 151645,
|
| 5 |
+
"pad_token_id": 151654,
|
| 6 |
+
"top_p": 0.9,
|
| 7 |
+
"top_k": 50,
|
| 8 |
+
"temperature": 0.7,
|
| 9 |
+
"repetition_penalty": 1.0,
|
| 10 |
+
"max_length": 32768,
|
| 11 |
+
"transformers_version": "4.57.3"
|
| 12 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model-00001-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7772c48c028ace57d9e3b5982f8dc29fdb808c12d0f52609a51d31f096a573b3
|
| 3 |
+
size 4986211280
|
model-00002-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b62e7a6aa87569bba41d5938524e2487d44741ac10073f4e56cad0470d9d844
|
| 3 |
+
size 4954847344
|
model-00003-of-00006.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:00533bbf80a0647f91c42b783269c79b2dd2706f75d8e9b6210ede471d716b42
|
| 3 |
+
size 3013472256
|
model.safetensors.index.json
ADDED
|
@@ -0,0 +1,586 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_size": 29540067328
|
| 4 |
+
},
|
| 5 |
+
"weight_map": {
|
| 6 |
+
"lm_head.weight": "model-00006-of-00006.safetensors",
|
| 7 |
+
"model.embed_tokens.weight": "model-00001-of-00006.safetensors",
|
| 8 |
+
"model.layers.0.input_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 9 |
+
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00006.safetensors",
|
| 10 |
+
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00006.safetensors",
|
| 11 |
+
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00006.safetensors",
|
| 12 |
+
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 13 |
+
"model.layers.0.self_attn.k_proj.bias": "model-00001-of-00006.safetensors",
|
| 14 |
+
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00006.safetensors",
|
| 15 |
+
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00006.safetensors",
|
| 16 |
+
"model.layers.0.self_attn.q_proj.bias": "model-00001-of-00006.safetensors",
|
| 17 |
+
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00006.safetensors",
|
| 18 |
+
"model.layers.0.self_attn.v_proj.bias": "model-00001-of-00006.safetensors",
|
| 19 |
+
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00006.safetensors",
|
| 20 |
+
"model.layers.1.input_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 21 |
+
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00006.safetensors",
|
| 22 |
+
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00006.safetensors",
|
| 23 |
+
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00006.safetensors",
|
| 24 |
+
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 25 |
+
"model.layers.1.self_attn.k_proj.bias": "model-00001-of-00006.safetensors",
|
| 26 |
+
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00006.safetensors",
|
| 27 |
+
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00006.safetensors",
|
| 28 |
+
"model.layers.1.self_attn.q_proj.bias": "model-00001-of-00006.safetensors",
|
| 29 |
+
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00006.safetensors",
|
| 30 |
+
"model.layers.1.self_attn.v_proj.bias": "model-00001-of-00006.safetensors",
|
| 31 |
+
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00006.safetensors",
|
| 32 |
+
"model.layers.10.input_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 33 |
+
"model.layers.10.mlp.down_proj.weight": "model-00002-of-00006.safetensors",
|
| 34 |
+
"model.layers.10.mlp.gate_proj.weight": "model-00002-of-00006.safetensors",
|
| 35 |
+
"model.layers.10.mlp.up_proj.weight": "model-00002-of-00006.safetensors",
|
| 36 |
+
"model.layers.10.post_attention_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 37 |
+
"model.layers.10.self_attn.k_proj.bias": "model-00002-of-00006.safetensors",
|
| 38 |
+
"model.layers.10.self_attn.k_proj.weight": "model-00002-of-00006.safetensors",
|
| 39 |
+
"model.layers.10.self_attn.o_proj.weight": "model-00002-of-00006.safetensors",
|
| 40 |
+
"model.layers.10.self_attn.q_proj.bias": "model-00002-of-00006.safetensors",
|
| 41 |
+
"model.layers.10.self_attn.q_proj.weight": "model-00002-of-00006.safetensors",
|
| 42 |
+
"model.layers.10.self_attn.v_proj.bias": "model-00002-of-00006.safetensors",
|
| 43 |
+
"model.layers.10.self_attn.v_proj.weight": "model-00002-of-00006.safetensors",
|
| 44 |
+
"model.layers.11.input_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 45 |
+
"model.layers.11.mlp.down_proj.weight": "model-00002-of-00006.safetensors",
|
| 46 |
+
"model.layers.11.mlp.gate_proj.weight": "model-00002-of-00006.safetensors",
|
| 47 |
+
"model.layers.11.mlp.up_proj.weight": "model-00002-of-00006.safetensors",
|
| 48 |
+
"model.layers.11.post_attention_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 49 |
+
"model.layers.11.self_attn.k_proj.bias": "model-00002-of-00006.safetensors",
|
| 50 |
+
"model.layers.11.self_attn.k_proj.weight": "model-00002-of-00006.safetensors",
|
| 51 |
+
"model.layers.11.self_attn.o_proj.weight": "model-00002-of-00006.safetensors",
|
| 52 |
+
"model.layers.11.self_attn.q_proj.bias": "model-00002-of-00006.safetensors",
|
| 53 |
+
"model.layers.11.self_attn.q_proj.weight": "model-00002-of-00006.safetensors",
|
| 54 |
+
"model.layers.11.self_attn.v_proj.bias": "model-00002-of-00006.safetensors",
|
| 55 |
+
"model.layers.11.self_attn.v_proj.weight": "model-00002-of-00006.safetensors",
|
| 56 |
+
"model.layers.12.input_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 57 |
+
"model.layers.12.mlp.down_proj.weight": "model-00002-of-00006.safetensors",
|
| 58 |
+
"model.layers.12.mlp.gate_proj.weight": "model-00002-of-00006.safetensors",
|
| 59 |
+
"model.layers.12.mlp.up_proj.weight": "model-00002-of-00006.safetensors",
|
| 60 |
+
"model.layers.12.post_attention_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 61 |
+
"model.layers.12.self_attn.k_proj.bias": "model-00002-of-00006.safetensors",
|
| 62 |
+
"model.layers.12.self_attn.k_proj.weight": "model-00002-of-00006.safetensors",
|
| 63 |
+
"model.layers.12.self_attn.o_proj.weight": "model-00002-of-00006.safetensors",
|
| 64 |
+
"model.layers.12.self_attn.q_proj.bias": "model-00002-of-00006.safetensors",
|
| 65 |
+
"model.layers.12.self_attn.q_proj.weight": "model-00002-of-00006.safetensors",
|
| 66 |
+
"model.layers.12.self_attn.v_proj.bias": "model-00002-of-00006.safetensors",
|
| 67 |
+
"model.layers.12.self_attn.v_proj.weight": "model-00002-of-00006.safetensors",
|
| 68 |
+
"model.layers.13.input_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 69 |
+
"model.layers.13.mlp.down_proj.weight": "model-00002-of-00006.safetensors",
|
| 70 |
+
"model.layers.13.mlp.gate_proj.weight": "model-00002-of-00006.safetensors",
|
| 71 |
+
"model.layers.13.mlp.up_proj.weight": "model-00002-of-00006.safetensors",
|
| 72 |
+
"model.layers.13.post_attention_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 73 |
+
"model.layers.13.self_attn.k_proj.bias": "model-00002-of-00006.safetensors",
|
| 74 |
+
"model.layers.13.self_attn.k_proj.weight": "model-00002-of-00006.safetensors",
|
| 75 |
+
"model.layers.13.self_attn.o_proj.weight": "model-00002-of-00006.safetensors",
|
| 76 |
+
"model.layers.13.self_attn.q_proj.bias": "model-00002-of-00006.safetensors",
|
| 77 |
+
"model.layers.13.self_attn.q_proj.weight": "model-00002-of-00006.safetensors",
|
| 78 |
+
"model.layers.13.self_attn.v_proj.bias": "model-00002-of-00006.safetensors",
|
| 79 |
+
"model.layers.13.self_attn.v_proj.weight": "model-00002-of-00006.safetensors",
|
| 80 |
+
"model.layers.14.input_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 81 |
+
"model.layers.14.mlp.down_proj.weight": "model-00002-of-00006.safetensors",
|
| 82 |
+
"model.layers.14.mlp.gate_proj.weight": "model-00002-of-00006.safetensors",
|
| 83 |
+
"model.layers.14.mlp.up_proj.weight": "model-00002-of-00006.safetensors",
|
| 84 |
+
"model.layers.14.post_attention_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 85 |
+
"model.layers.14.self_attn.k_proj.bias": "model-00002-of-00006.safetensors",
|
| 86 |
+
"model.layers.14.self_attn.k_proj.weight": "model-00002-of-00006.safetensors",
|
| 87 |
+
"model.layers.14.self_attn.o_proj.weight": "model-00002-of-00006.safetensors",
|
| 88 |
+
"model.layers.14.self_attn.q_proj.bias": "model-00002-of-00006.safetensors",
|
| 89 |
+
"model.layers.14.self_attn.q_proj.weight": "model-00002-of-00006.safetensors",
|
| 90 |
+
"model.layers.14.self_attn.v_proj.bias": "model-00002-of-00006.safetensors",
|
| 91 |
+
"model.layers.14.self_attn.v_proj.weight": "model-00002-of-00006.safetensors",
|
| 92 |
+
"model.layers.15.input_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 93 |
+
"model.layers.15.mlp.down_proj.weight": "model-00003-of-00006.safetensors",
|
| 94 |
+
"model.layers.15.mlp.gate_proj.weight": "model-00003-of-00006.safetensors",
|
| 95 |
+
"model.layers.15.mlp.up_proj.weight": "model-00003-of-00006.safetensors",
|
| 96 |
+
"model.layers.15.post_attention_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 97 |
+
"model.layers.15.self_attn.k_proj.bias": "model-00002-of-00006.safetensors",
|
| 98 |
+
"model.layers.15.self_attn.k_proj.weight": "model-00002-of-00006.safetensors",
|
| 99 |
+
"model.layers.15.self_attn.o_proj.weight": "model-00002-of-00006.safetensors",
|
| 100 |
+
"model.layers.15.self_attn.q_proj.bias": "model-00002-of-00006.safetensors",
|
| 101 |
+
"model.layers.15.self_attn.q_proj.weight": "model-00002-of-00006.safetensors",
|
| 102 |
+
"model.layers.15.self_attn.v_proj.bias": "model-00002-of-00006.safetensors",
|
| 103 |
+
"model.layers.15.self_attn.v_proj.weight": "model-00002-of-00006.safetensors",
|
| 104 |
+
"model.layers.16.input_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 105 |
+
"model.layers.16.mlp.down_proj.weight": "model-00003-of-00006.safetensors",
|
| 106 |
+
"model.layers.16.mlp.gate_proj.weight": "model-00003-of-00006.safetensors",
|
| 107 |
+
"model.layers.16.mlp.up_proj.weight": "model-00003-of-00006.safetensors",
|
| 108 |
+
"model.layers.16.post_attention_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 109 |
+
"model.layers.16.self_attn.k_proj.bias": "model-00003-of-00006.safetensors",
|
| 110 |
+
"model.layers.16.self_attn.k_proj.weight": "model-00003-of-00006.safetensors",
|
| 111 |
+
"model.layers.16.self_attn.o_proj.weight": "model-00003-of-00006.safetensors",
|
| 112 |
+
"model.layers.16.self_attn.q_proj.bias": "model-00003-of-00006.safetensors",
|
| 113 |
+
"model.layers.16.self_attn.q_proj.weight": "model-00003-of-00006.safetensors",
|
| 114 |
+
"model.layers.16.self_attn.v_proj.bias": "model-00003-of-00006.safetensors",
|
| 115 |
+
"model.layers.16.self_attn.v_proj.weight": "model-00003-of-00006.safetensors",
|
| 116 |
+
"model.layers.17.input_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 117 |
+
"model.layers.17.mlp.down_proj.weight": "model-00003-of-00006.safetensors",
|
| 118 |
+
"model.layers.17.mlp.gate_proj.weight": "model-00003-of-00006.safetensors",
|
| 119 |
+
"model.layers.17.mlp.up_proj.weight": "model-00003-of-00006.safetensors",
|
| 120 |
+
"model.layers.17.post_attention_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 121 |
+
"model.layers.17.self_attn.k_proj.bias": "model-00003-of-00006.safetensors",
|
| 122 |
+
"model.layers.17.self_attn.k_proj.weight": "model-00003-of-00006.safetensors",
|
| 123 |
+
"model.layers.17.self_attn.o_proj.weight": "model-00003-of-00006.safetensors",
|
| 124 |
+
"model.layers.17.self_attn.q_proj.bias": "model-00003-of-00006.safetensors",
|
| 125 |
+
"model.layers.17.self_attn.q_proj.weight": "model-00003-of-00006.safetensors",
|
| 126 |
+
"model.layers.17.self_attn.v_proj.bias": "model-00003-of-00006.safetensors",
|
| 127 |
+
"model.layers.17.self_attn.v_proj.weight": "model-00003-of-00006.safetensors",
|
| 128 |
+
"model.layers.18.input_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 129 |
+
"model.layers.18.mlp.down_proj.weight": "model-00003-of-00006.safetensors",
|
| 130 |
+
"model.layers.18.mlp.gate_proj.weight": "model-00003-of-00006.safetensors",
|
| 131 |
+
"model.layers.18.mlp.up_proj.weight": "model-00003-of-00006.safetensors",
|
| 132 |
+
"model.layers.18.post_attention_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 133 |
+
"model.layers.18.self_attn.k_proj.bias": "model-00003-of-00006.safetensors",
|
| 134 |
+
"model.layers.18.self_attn.k_proj.weight": "model-00003-of-00006.safetensors",
|
| 135 |
+
"model.layers.18.self_attn.o_proj.weight": "model-00003-of-00006.safetensors",
|
| 136 |
+
"model.layers.18.self_attn.q_proj.bias": "model-00003-of-00006.safetensors",
|
| 137 |
+
"model.layers.18.self_attn.q_proj.weight": "model-00003-of-00006.safetensors",
|
| 138 |
+
"model.layers.18.self_attn.v_proj.bias": "model-00003-of-00006.safetensors",
|
| 139 |
+
"model.layers.18.self_attn.v_proj.weight": "model-00003-of-00006.safetensors",
|
| 140 |
+
"model.layers.19.input_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 141 |
+
"model.layers.19.mlp.down_proj.weight": "model-00003-of-00006.safetensors",
|
| 142 |
+
"model.layers.19.mlp.gate_proj.weight": "model-00003-of-00006.safetensors",
|
| 143 |
+
"model.layers.19.mlp.up_proj.weight": "model-00003-of-00006.safetensors",
|
| 144 |
+
"model.layers.19.post_attention_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 145 |
+
"model.layers.19.self_attn.k_proj.bias": "model-00003-of-00006.safetensors",
|
| 146 |
+
"model.layers.19.self_attn.k_proj.weight": "model-00003-of-00006.safetensors",
|
| 147 |
+
"model.layers.19.self_attn.o_proj.weight": "model-00003-of-00006.safetensors",
|
| 148 |
+
"model.layers.19.self_attn.q_proj.bias": "model-00003-of-00006.safetensors",
|
| 149 |
+
"model.layers.19.self_attn.q_proj.weight": "model-00003-of-00006.safetensors",
|
| 150 |
+
"model.layers.19.self_attn.v_proj.bias": "model-00003-of-00006.safetensors",
|
| 151 |
+
"model.layers.19.self_attn.v_proj.weight": "model-00003-of-00006.safetensors",
|
| 152 |
+
"model.layers.2.input_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 153 |
+
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00006.safetensors",
|
| 154 |
+
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-00006.safetensors",
|
| 155 |
+
"model.layers.2.mlp.up_proj.weight": "model-00001-of-00006.safetensors",
|
| 156 |
+
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 157 |
+
"model.layers.2.self_attn.k_proj.bias": "model-00001-of-00006.safetensors",
|
| 158 |
+
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00006.safetensors",
|
| 159 |
+
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00006.safetensors",
|
| 160 |
+
"model.layers.2.self_attn.q_proj.bias": "model-00001-of-00006.safetensors",
|
| 161 |
+
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00006.safetensors",
|
| 162 |
+
"model.layers.2.self_attn.v_proj.bias": "model-00001-of-00006.safetensors",
|
| 163 |
+
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00006.safetensors",
|
| 164 |
+
"model.layers.20.input_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 165 |
+
"model.layers.20.mlp.down_proj.weight": "model-00003-of-00006.safetensors",
|
| 166 |
+
"model.layers.20.mlp.gate_proj.weight": "model-00003-of-00006.safetensors",
|
| 167 |
+
"model.layers.20.mlp.up_proj.weight": "model-00003-of-00006.safetensors",
|
| 168 |
+
"model.layers.20.post_attention_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 169 |
+
"model.layers.20.self_attn.k_proj.bias": "model-00003-of-00006.safetensors",
|
| 170 |
+
"model.layers.20.self_attn.k_proj.weight": "model-00003-of-00006.safetensors",
|
| 171 |
+
"model.layers.20.self_attn.o_proj.weight": "model-00003-of-00006.safetensors",
|
| 172 |
+
"model.layers.20.self_attn.q_proj.bias": "model-00003-of-00006.safetensors",
|
| 173 |
+
"model.layers.20.self_attn.q_proj.weight": "model-00003-of-00006.safetensors",
|
| 174 |
+
"model.layers.20.self_attn.v_proj.bias": "model-00003-of-00006.safetensors",
|
| 175 |
+
"model.layers.20.self_attn.v_proj.weight": "model-00003-of-00006.safetensors",
|
| 176 |
+
"model.layers.21.input_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 177 |
+
"model.layers.21.mlp.down_proj.weight": "model-00003-of-00006.safetensors",
|
| 178 |
+
"model.layers.21.mlp.gate_proj.weight": "model-00003-of-00006.safetensors",
|
| 179 |
+
"model.layers.21.mlp.up_proj.weight": "model-00003-of-00006.safetensors",
|
| 180 |
+
"model.layers.21.post_attention_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 181 |
+
"model.layers.21.self_attn.k_proj.bias": "model-00003-of-00006.safetensors",
|
| 182 |
+
"model.layers.21.self_attn.k_proj.weight": "model-00003-of-00006.safetensors",
|
| 183 |
+
"model.layers.21.self_attn.o_proj.weight": "model-00003-of-00006.safetensors",
|
| 184 |
+
"model.layers.21.self_attn.q_proj.bias": "model-00003-of-00006.safetensors",
|
| 185 |
+
"model.layers.21.self_attn.q_proj.weight": "model-00003-of-00006.safetensors",
|
| 186 |
+
"model.layers.21.self_attn.v_proj.bias": "model-00003-of-00006.safetensors",
|
| 187 |
+
"model.layers.21.self_attn.v_proj.weight": "model-00003-of-00006.safetensors",
|
| 188 |
+
"model.layers.22.input_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 189 |
+
"model.layers.22.mlp.down_proj.weight": "model-00003-of-00006.safetensors",
|
| 190 |
+
"model.layers.22.mlp.gate_proj.weight": "model-00003-of-00006.safetensors",
|
| 191 |
+
"model.layers.22.mlp.up_proj.weight": "model-00003-of-00006.safetensors",
|
| 192 |
+
"model.layers.22.post_attention_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 193 |
+
"model.layers.22.self_attn.k_proj.bias": "model-00003-of-00006.safetensors",
|
| 194 |
+
"model.layers.22.self_attn.k_proj.weight": "model-00003-of-00006.safetensors",
|
| 195 |
+
"model.layers.22.self_attn.o_proj.weight": "model-00003-of-00006.safetensors",
|
| 196 |
+
"model.layers.22.self_attn.q_proj.bias": "model-00003-of-00006.safetensors",
|
| 197 |
+
"model.layers.22.self_attn.q_proj.weight": "model-00003-of-00006.safetensors",
|
| 198 |
+
"model.layers.22.self_attn.v_proj.bias": "model-00003-of-00006.safetensors",
|
| 199 |
+
"model.layers.22.self_attn.v_proj.weight": "model-00003-of-00006.safetensors",
|
| 200 |
+
"model.layers.23.input_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 201 |
+
"model.layers.23.mlp.down_proj.weight": "model-00003-of-00006.safetensors",
|
| 202 |
+
"model.layers.23.mlp.gate_proj.weight": "model-00003-of-00006.safetensors",
|
| 203 |
+
"model.layers.23.mlp.up_proj.weight": "model-00003-of-00006.safetensors",
|
| 204 |
+
"model.layers.23.post_attention_layernorm.weight": "model-00003-of-00006.safetensors",
|
| 205 |
+
"model.layers.23.self_attn.k_proj.bias": "model-00003-of-00006.safetensors",
|
| 206 |
+
"model.layers.23.self_attn.k_proj.weight": "model-00003-of-00006.safetensors",
|
| 207 |
+
"model.layers.23.self_attn.o_proj.weight": "model-00003-of-00006.safetensors",
|
| 208 |
+
"model.layers.23.self_attn.q_proj.bias": "model-00003-of-00006.safetensors",
|
| 209 |
+
"model.layers.23.self_attn.q_proj.weight": "model-00003-of-00006.safetensors",
|
| 210 |
+
"model.layers.23.self_attn.v_proj.bias": "model-00003-of-00006.safetensors",
|
| 211 |
+
"model.layers.23.self_attn.v_proj.weight": "model-00003-of-00006.safetensors",
|
| 212 |
+
"model.layers.24.input_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 213 |
+
"model.layers.24.mlp.down_proj.weight": "model-00004-of-00006.safetensors",
|
| 214 |
+
"model.layers.24.mlp.gate_proj.weight": "model-00004-of-00006.safetensors",
|
| 215 |
+
"model.layers.24.mlp.up_proj.weight": "model-00004-of-00006.safetensors",
|
| 216 |
+
"model.layers.24.post_attention_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 217 |
+
"model.layers.24.self_attn.k_proj.bias": "model-00003-of-00006.safetensors",
|
| 218 |
+
"model.layers.24.self_attn.k_proj.weight": "model-00003-of-00006.safetensors",
|
| 219 |
+
"model.layers.24.self_attn.o_proj.weight": "model-00003-of-00006.safetensors",
|
| 220 |
+
"model.layers.24.self_attn.q_proj.bias": "model-00003-of-00006.safetensors",
|
| 221 |
+
"model.layers.24.self_attn.q_proj.weight": "model-00003-of-00006.safetensors",
|
| 222 |
+
"model.layers.24.self_attn.v_proj.bias": "model-00003-of-00006.safetensors",
|
| 223 |
+
"model.layers.24.self_attn.v_proj.weight": "model-00003-of-00006.safetensors",
|
| 224 |
+
"model.layers.25.input_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 225 |
+
"model.layers.25.mlp.down_proj.weight": "model-00004-of-00006.safetensors",
|
| 226 |
+
"model.layers.25.mlp.gate_proj.weight": "model-00004-of-00006.safetensors",
|
| 227 |
+
"model.layers.25.mlp.up_proj.weight": "model-00004-of-00006.safetensors",
|
| 228 |
+
"model.layers.25.post_attention_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 229 |
+
"model.layers.25.self_attn.k_proj.bias": "model-00004-of-00006.safetensors",
|
| 230 |
+
"model.layers.25.self_attn.k_proj.weight": "model-00004-of-00006.safetensors",
|
| 231 |
+
"model.layers.25.self_attn.o_proj.weight": "model-00004-of-00006.safetensors",
|
| 232 |
+
"model.layers.25.self_attn.q_proj.bias": "model-00004-of-00006.safetensors",
|
| 233 |
+
"model.layers.25.self_attn.q_proj.weight": "model-00004-of-00006.safetensors",
|
| 234 |
+
"model.layers.25.self_attn.v_proj.bias": "model-00004-of-00006.safetensors",
|
| 235 |
+
"model.layers.25.self_attn.v_proj.weight": "model-00004-of-00006.safetensors",
|
| 236 |
+
"model.layers.26.input_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 237 |
+
"model.layers.26.mlp.down_proj.weight": "model-00004-of-00006.safetensors",
|
| 238 |
+
"model.layers.26.mlp.gate_proj.weight": "model-00004-of-00006.safetensors",
|
| 239 |
+
"model.layers.26.mlp.up_proj.weight": "model-00004-of-00006.safetensors",
|
| 240 |
+
"model.layers.26.post_attention_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 241 |
+
"model.layers.26.self_attn.k_proj.bias": "model-00004-of-00006.safetensors",
|
| 242 |
+
"model.layers.26.self_attn.k_proj.weight": "model-00004-of-00006.safetensors",
|
| 243 |
+
"model.layers.26.self_attn.o_proj.weight": "model-00004-of-00006.safetensors",
|
| 244 |
+
"model.layers.26.self_attn.q_proj.bias": "model-00004-of-00006.safetensors",
|
| 245 |
+
"model.layers.26.self_attn.q_proj.weight": "model-00004-of-00006.safetensors",
|
| 246 |
+
"model.layers.26.self_attn.v_proj.bias": "model-00004-of-00006.safetensors",
|
| 247 |
+
"model.layers.26.self_attn.v_proj.weight": "model-00004-of-00006.safetensors",
|
| 248 |
+
"model.layers.27.input_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 249 |
+
"model.layers.27.mlp.down_proj.weight": "model-00004-of-00006.safetensors",
|
| 250 |
+
"model.layers.27.mlp.gate_proj.weight": "model-00004-of-00006.safetensors",
|
| 251 |
+
"model.layers.27.mlp.up_proj.weight": "model-00004-of-00006.safetensors",
|
| 252 |
+
"model.layers.27.post_attention_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 253 |
+
"model.layers.27.self_attn.k_proj.bias": "model-00004-of-00006.safetensors",
|
| 254 |
+
"model.layers.27.self_attn.k_proj.weight": "model-00004-of-00006.safetensors",
|
| 255 |
+
"model.layers.27.self_attn.o_proj.weight": "model-00004-of-00006.safetensors",
|
| 256 |
+
"model.layers.27.self_attn.q_proj.bias": "model-00004-of-00006.safetensors",
|
| 257 |
+
"model.layers.27.self_attn.q_proj.weight": "model-00004-of-00006.safetensors",
|
| 258 |
+
"model.layers.27.self_attn.v_proj.bias": "model-00004-of-00006.safetensors",
|
| 259 |
+
"model.layers.27.self_attn.v_proj.weight": "model-00004-of-00006.safetensors",
|
| 260 |
+
"model.layers.28.input_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 261 |
+
"model.layers.28.mlp.down_proj.weight": "model-00004-of-00006.safetensors",
|
| 262 |
+
"model.layers.28.mlp.gate_proj.weight": "model-00004-of-00006.safetensors",
|
| 263 |
+
"model.layers.28.mlp.up_proj.weight": "model-00004-of-00006.safetensors",
|
| 264 |
+
"model.layers.28.post_attention_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 265 |
+
"model.layers.28.self_attn.k_proj.bias": "model-00004-of-00006.safetensors",
|
| 266 |
+
"model.layers.28.self_attn.k_proj.weight": "model-00004-of-00006.safetensors",
|
| 267 |
+
"model.layers.28.self_attn.o_proj.weight": "model-00004-of-00006.safetensors",
|
| 268 |
+
"model.layers.28.self_attn.q_proj.bias": "model-00004-of-00006.safetensors",
|
| 269 |
+
"model.layers.28.self_attn.q_proj.weight": "model-00004-of-00006.safetensors",
|
| 270 |
+
"model.layers.28.self_attn.v_proj.bias": "model-00004-of-00006.safetensors",
|
| 271 |
+
"model.layers.28.self_attn.v_proj.weight": "model-00004-of-00006.safetensors",
|
| 272 |
+
"model.layers.29.input_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 273 |
+
"model.layers.29.mlp.down_proj.weight": "model-00004-of-00006.safetensors",
|
| 274 |
+
"model.layers.29.mlp.gate_proj.weight": "model-00004-of-00006.safetensors",
|
| 275 |
+
"model.layers.29.mlp.up_proj.weight": "model-00004-of-00006.safetensors",
|
| 276 |
+
"model.layers.29.post_attention_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 277 |
+
"model.layers.29.self_attn.k_proj.bias": "model-00004-of-00006.safetensors",
|
| 278 |
+
"model.layers.29.self_attn.k_proj.weight": "model-00004-of-00006.safetensors",
|
| 279 |
+
"model.layers.29.self_attn.o_proj.weight": "model-00004-of-00006.safetensors",
|
| 280 |
+
"model.layers.29.self_attn.q_proj.bias": "model-00004-of-00006.safetensors",
|
| 281 |
+
"model.layers.29.self_attn.q_proj.weight": "model-00004-of-00006.safetensors",
|
| 282 |
+
"model.layers.29.self_attn.v_proj.bias": "model-00004-of-00006.safetensors",
|
| 283 |
+
"model.layers.29.self_attn.v_proj.weight": "model-00004-of-00006.safetensors",
|
| 284 |
+
"model.layers.3.input_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 285 |
+
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00006.safetensors",
|
| 286 |
+
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-00006.safetensors",
|
| 287 |
+
"model.layers.3.mlp.up_proj.weight": "model-00001-of-00006.safetensors",
|
| 288 |
+
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 289 |
+
"model.layers.3.self_attn.k_proj.bias": "model-00001-of-00006.safetensors",
|
| 290 |
+
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00006.safetensors",
|
| 291 |
+
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00006.safetensors",
|
| 292 |
+
"model.layers.3.self_attn.q_proj.bias": "model-00001-of-00006.safetensors",
|
| 293 |
+
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00006.safetensors",
|
| 294 |
+
"model.layers.3.self_attn.v_proj.bias": "model-00001-of-00006.safetensors",
|
| 295 |
+
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00006.safetensors",
|
| 296 |
+
"model.layers.30.input_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 297 |
+
"model.layers.30.mlp.down_proj.weight": "model-00004-of-00006.safetensors",
|
| 298 |
+
"model.layers.30.mlp.gate_proj.weight": "model-00004-of-00006.safetensors",
|
| 299 |
+
"model.layers.30.mlp.up_proj.weight": "model-00004-of-00006.safetensors",
|
| 300 |
+
"model.layers.30.post_attention_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 301 |
+
"model.layers.30.self_attn.k_proj.bias": "model-00004-of-00006.safetensors",
|
| 302 |
+
"model.layers.30.self_attn.k_proj.weight": "model-00004-of-00006.safetensors",
|
| 303 |
+
"model.layers.30.self_attn.o_proj.weight": "model-00004-of-00006.safetensors",
|
| 304 |
+
"model.layers.30.self_attn.q_proj.bias": "model-00004-of-00006.safetensors",
|
| 305 |
+
"model.layers.30.self_attn.q_proj.weight": "model-00004-of-00006.safetensors",
|
| 306 |
+
"model.layers.30.self_attn.v_proj.bias": "model-00004-of-00006.safetensors",
|
| 307 |
+
"model.layers.30.self_attn.v_proj.weight": "model-00004-of-00006.safetensors",
|
| 308 |
+
"model.layers.31.input_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 309 |
+
"model.layers.31.mlp.down_proj.weight": "model-00004-of-00006.safetensors",
|
| 310 |
+
"model.layers.31.mlp.gate_proj.weight": "model-00004-of-00006.safetensors",
|
| 311 |
+
"model.layers.31.mlp.up_proj.weight": "model-00004-of-00006.safetensors",
|
| 312 |
+
"model.layers.31.post_attention_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 313 |
+
"model.layers.31.self_attn.k_proj.bias": "model-00004-of-00006.safetensors",
|
| 314 |
+
"model.layers.31.self_attn.k_proj.weight": "model-00004-of-00006.safetensors",
|
| 315 |
+
"model.layers.31.self_attn.o_proj.weight": "model-00004-of-00006.safetensors",
|
| 316 |
+
"model.layers.31.self_attn.q_proj.bias": "model-00004-of-00006.safetensors",
|
| 317 |
+
"model.layers.31.self_attn.q_proj.weight": "model-00004-of-00006.safetensors",
|
| 318 |
+
"model.layers.31.self_attn.v_proj.bias": "model-00004-of-00006.safetensors",
|
| 319 |
+
"model.layers.31.self_attn.v_proj.weight": "model-00004-of-00006.safetensors",
|
| 320 |
+
"model.layers.32.input_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 321 |
+
"model.layers.32.mlp.down_proj.weight": "model-00004-of-00006.safetensors",
|
| 322 |
+
"model.layers.32.mlp.gate_proj.weight": "model-00004-of-00006.safetensors",
|
| 323 |
+
"model.layers.32.mlp.up_proj.weight": "model-00004-of-00006.safetensors",
|
| 324 |
+
"model.layers.32.post_attention_layernorm.weight": "model-00004-of-00006.safetensors",
|
| 325 |
+
"model.layers.32.self_attn.k_proj.bias": "model-00004-of-00006.safetensors",
|
| 326 |
+
"model.layers.32.self_attn.k_proj.weight": "model-00004-of-00006.safetensors",
|
| 327 |
+
"model.layers.32.self_attn.o_proj.weight": "model-00004-of-00006.safetensors",
|
| 328 |
+
"model.layers.32.self_attn.q_proj.bias": "model-00004-of-00006.safetensors",
|
| 329 |
+
"model.layers.32.self_attn.q_proj.weight": "model-00004-of-00006.safetensors",
|
| 330 |
+
"model.layers.32.self_attn.v_proj.bias": "model-00004-of-00006.safetensors",
|
| 331 |
+
"model.layers.32.self_attn.v_proj.weight": "model-00004-of-00006.safetensors",
|
| 332 |
+
"model.layers.33.input_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 333 |
+
"model.layers.33.mlp.down_proj.weight": "model-00005-of-00006.safetensors",
|
| 334 |
+
"model.layers.33.mlp.gate_proj.weight": "model-00005-of-00006.safetensors",
|
| 335 |
+
"model.layers.33.mlp.up_proj.weight": "model-00005-of-00006.safetensors",
|
| 336 |
+
"model.layers.33.post_attention_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 337 |
+
"model.layers.33.self_attn.k_proj.bias": "model-00004-of-00006.safetensors",
|
| 338 |
+
"model.layers.33.self_attn.k_proj.weight": "model-00004-of-00006.safetensors",
|
| 339 |
+
"model.layers.33.self_attn.o_proj.weight": "model-00004-of-00006.safetensors",
|
| 340 |
+
"model.layers.33.self_attn.q_proj.bias": "model-00004-of-00006.safetensors",
|
| 341 |
+
"model.layers.33.self_attn.q_proj.weight": "model-00004-of-00006.safetensors",
|
| 342 |
+
"model.layers.33.self_attn.v_proj.bias": "model-00004-of-00006.safetensors",
|
| 343 |
+
"model.layers.33.self_attn.v_proj.weight": "model-00004-of-00006.safetensors",
|
| 344 |
+
"model.layers.34.input_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 345 |
+
"model.layers.34.mlp.down_proj.weight": "model-00005-of-00006.safetensors",
|
| 346 |
+
"model.layers.34.mlp.gate_proj.weight": "model-00005-of-00006.safetensors",
|
| 347 |
+
"model.layers.34.mlp.up_proj.weight": "model-00005-of-00006.safetensors",
|
| 348 |
+
"model.layers.34.post_attention_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 349 |
+
"model.layers.34.self_attn.k_proj.bias": "model-00005-of-00006.safetensors",
|
| 350 |
+
"model.layers.34.self_attn.k_proj.weight": "model-00005-of-00006.safetensors",
|
| 351 |
+
"model.layers.34.self_attn.o_proj.weight": "model-00005-of-00006.safetensors",
|
| 352 |
+
"model.layers.34.self_attn.q_proj.bias": "model-00005-of-00006.safetensors",
|
| 353 |
+
"model.layers.34.self_attn.q_proj.weight": "model-00005-of-00006.safetensors",
|
| 354 |
+
"model.layers.34.self_attn.v_proj.bias": "model-00005-of-00006.safetensors",
|
| 355 |
+
"model.layers.34.self_attn.v_proj.weight": "model-00005-of-00006.safetensors",
|
| 356 |
+
"model.layers.35.input_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 357 |
+
"model.layers.35.mlp.down_proj.weight": "model-00005-of-00006.safetensors",
|
| 358 |
+
"model.layers.35.mlp.gate_proj.weight": "model-00005-of-00006.safetensors",
|
| 359 |
+
"model.layers.35.mlp.up_proj.weight": "model-00005-of-00006.safetensors",
|
| 360 |
+
"model.layers.35.post_attention_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 361 |
+
"model.layers.35.self_attn.k_proj.bias": "model-00005-of-00006.safetensors",
|
| 362 |
+
"model.layers.35.self_attn.k_proj.weight": "model-00005-of-00006.safetensors",
|
| 363 |
+
"model.layers.35.self_attn.o_proj.weight": "model-00005-of-00006.safetensors",
|
| 364 |
+
"model.layers.35.self_attn.q_proj.bias": "model-00005-of-00006.safetensors",
|
| 365 |
+
"model.layers.35.self_attn.q_proj.weight": "model-00005-of-00006.safetensors",
|
| 366 |
+
"model.layers.35.self_attn.v_proj.bias": "model-00005-of-00006.safetensors",
|
| 367 |
+
"model.layers.35.self_attn.v_proj.weight": "model-00005-of-00006.safetensors",
|
| 368 |
+
"model.layers.36.input_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 369 |
+
"model.layers.36.mlp.down_proj.weight": "model-00005-of-00006.safetensors",
|
| 370 |
+
"model.layers.36.mlp.gate_proj.weight": "model-00005-of-00006.safetensors",
|
| 371 |
+
"model.layers.36.mlp.up_proj.weight": "model-00005-of-00006.safetensors",
|
| 372 |
+
"model.layers.36.post_attention_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 373 |
+
"model.layers.36.self_attn.k_proj.bias": "model-00005-of-00006.safetensors",
|
| 374 |
+
"model.layers.36.self_attn.k_proj.weight": "model-00005-of-00006.safetensors",
|
| 375 |
+
"model.layers.36.self_attn.o_proj.weight": "model-00005-of-00006.safetensors",
|
| 376 |
+
"model.layers.36.self_attn.q_proj.bias": "model-00005-of-00006.safetensors",
|
| 377 |
+
"model.layers.36.self_attn.q_proj.weight": "model-00005-of-00006.safetensors",
|
| 378 |
+
"model.layers.36.self_attn.v_proj.bias": "model-00005-of-00006.safetensors",
|
| 379 |
+
"model.layers.36.self_attn.v_proj.weight": "model-00005-of-00006.safetensors",
|
| 380 |
+
"model.layers.37.input_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 381 |
+
"model.layers.37.mlp.down_proj.weight": "model-00005-of-00006.safetensors",
|
| 382 |
+
"model.layers.37.mlp.gate_proj.weight": "model-00005-of-00006.safetensors",
|
| 383 |
+
"model.layers.37.mlp.up_proj.weight": "model-00005-of-00006.safetensors",
|
| 384 |
+
"model.layers.37.post_attention_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 385 |
+
"model.layers.37.self_attn.k_proj.bias": "model-00005-of-00006.safetensors",
|
| 386 |
+
"model.layers.37.self_attn.k_proj.weight": "model-00005-of-00006.safetensors",
|
| 387 |
+
"model.layers.37.self_attn.o_proj.weight": "model-00005-of-00006.safetensors",
|
| 388 |
+
"model.layers.37.self_attn.q_proj.bias": "model-00005-of-00006.safetensors",
|
| 389 |
+
"model.layers.37.self_attn.q_proj.weight": "model-00005-of-00006.safetensors",
|
| 390 |
+
"model.layers.37.self_attn.v_proj.bias": "model-00005-of-00006.safetensors",
|
| 391 |
+
"model.layers.37.self_attn.v_proj.weight": "model-00005-of-00006.safetensors",
|
| 392 |
+
"model.layers.38.input_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 393 |
+
"model.layers.38.mlp.down_proj.weight": "model-00005-of-00006.safetensors",
|
| 394 |
+
"model.layers.38.mlp.gate_proj.weight": "model-00005-of-00006.safetensors",
|
| 395 |
+
"model.layers.38.mlp.up_proj.weight": "model-00005-of-00006.safetensors",
|
| 396 |
+
"model.layers.38.post_attention_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 397 |
+
"model.layers.38.self_attn.k_proj.bias": "model-00005-of-00006.safetensors",
|
| 398 |
+
"model.layers.38.self_attn.k_proj.weight": "model-00005-of-00006.safetensors",
|
| 399 |
+
"model.layers.38.self_attn.o_proj.weight": "model-00005-of-00006.safetensors",
|
| 400 |
+
"model.layers.38.self_attn.q_proj.bias": "model-00005-of-00006.safetensors",
|
| 401 |
+
"model.layers.38.self_attn.q_proj.weight": "model-00005-of-00006.safetensors",
|
| 402 |
+
"model.layers.38.self_attn.v_proj.bias": "model-00005-of-00006.safetensors",
|
| 403 |
+
"model.layers.38.self_attn.v_proj.weight": "model-00005-of-00006.safetensors",
|
| 404 |
+
"model.layers.39.input_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 405 |
+
"model.layers.39.mlp.down_proj.weight": "model-00005-of-00006.safetensors",
|
| 406 |
+
"model.layers.39.mlp.gate_proj.weight": "model-00005-of-00006.safetensors",
|
| 407 |
+
"model.layers.39.mlp.up_proj.weight": "model-00005-of-00006.safetensors",
|
| 408 |
+
"model.layers.39.post_attention_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 409 |
+
"model.layers.39.self_attn.k_proj.bias": "model-00005-of-00006.safetensors",
|
| 410 |
+
"model.layers.39.self_attn.k_proj.weight": "model-00005-of-00006.safetensors",
|
| 411 |
+
"model.layers.39.self_attn.o_proj.weight": "model-00005-of-00006.safetensors",
|
| 412 |
+
"model.layers.39.self_attn.q_proj.bias": "model-00005-of-00006.safetensors",
|
| 413 |
+
"model.layers.39.self_attn.q_proj.weight": "model-00005-of-00006.safetensors",
|
| 414 |
+
"model.layers.39.self_attn.v_proj.bias": "model-00005-of-00006.safetensors",
|
| 415 |
+
"model.layers.39.self_attn.v_proj.weight": "model-00005-of-00006.safetensors",
|
| 416 |
+
"model.layers.4.input_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 417 |
+
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00006.safetensors",
|
| 418 |
+
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00006.safetensors",
|
| 419 |
+
"model.layers.4.mlp.up_proj.weight": "model-00001-of-00006.safetensors",
|
| 420 |
+
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 421 |
+
"model.layers.4.self_attn.k_proj.bias": "model-00001-of-00006.safetensors",
|
| 422 |
+
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00006.safetensors",
|
| 423 |
+
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00006.safetensors",
|
| 424 |
+
"model.layers.4.self_attn.q_proj.bias": "model-00001-of-00006.safetensors",
|
| 425 |
+
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00006.safetensors",
|
| 426 |
+
"model.layers.4.self_attn.v_proj.bias": "model-00001-of-00006.safetensors",
|
| 427 |
+
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00006.safetensors",
|
| 428 |
+
"model.layers.40.input_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 429 |
+
"model.layers.40.mlp.down_proj.weight": "model-00005-of-00006.safetensors",
|
| 430 |
+
"model.layers.40.mlp.gate_proj.weight": "model-00005-of-00006.safetensors",
|
| 431 |
+
"model.layers.40.mlp.up_proj.weight": "model-00005-of-00006.safetensors",
|
| 432 |
+
"model.layers.40.post_attention_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 433 |
+
"model.layers.40.self_attn.k_proj.bias": "model-00005-of-00006.safetensors",
|
| 434 |
+
"model.layers.40.self_attn.k_proj.weight": "model-00005-of-00006.safetensors",
|
| 435 |
+
"model.layers.40.self_attn.o_proj.weight": "model-00005-of-00006.safetensors",
|
| 436 |
+
"model.layers.40.self_attn.q_proj.bias": "model-00005-of-00006.safetensors",
|
| 437 |
+
"model.layers.40.self_attn.q_proj.weight": "model-00005-of-00006.safetensors",
|
| 438 |
+
"model.layers.40.self_attn.v_proj.bias": "model-00005-of-00006.safetensors",
|
| 439 |
+
"model.layers.40.self_attn.v_proj.weight": "model-00005-of-00006.safetensors",
|
| 440 |
+
"model.layers.41.input_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 441 |
+
"model.layers.41.mlp.down_proj.weight": "model-00005-of-00006.safetensors",
|
| 442 |
+
"model.layers.41.mlp.gate_proj.weight": "model-00005-of-00006.safetensors",
|
| 443 |
+
"model.layers.41.mlp.up_proj.weight": "model-00005-of-00006.safetensors",
|
| 444 |
+
"model.layers.41.post_attention_layernorm.weight": "model-00005-of-00006.safetensors",
|
| 445 |
+
"model.layers.41.self_attn.k_proj.bias": "model-00005-of-00006.safetensors",
|
| 446 |
+
"model.layers.41.self_attn.k_proj.weight": "model-00005-of-00006.safetensors",
|
| 447 |
+
"model.layers.41.self_attn.o_proj.weight": "model-00005-of-00006.safetensors",
|
| 448 |
+
"model.layers.41.self_attn.q_proj.bias": "model-00005-of-00006.safetensors",
|
| 449 |
+
"model.layers.41.self_attn.q_proj.weight": "model-00005-of-00006.safetensors",
|
| 450 |
+
"model.layers.41.self_attn.v_proj.bias": "model-00005-of-00006.safetensors",
|
| 451 |
+
"model.layers.41.self_attn.v_proj.weight": "model-00005-of-00006.safetensors",
|
| 452 |
+
"model.layers.42.input_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 453 |
+
"model.layers.42.mlp.down_proj.weight": "model-00006-of-00006.safetensors",
|
| 454 |
+
"model.layers.42.mlp.gate_proj.weight": "model-00006-of-00006.safetensors",
|
| 455 |
+
"model.layers.42.mlp.up_proj.weight": "model-00006-of-00006.safetensors",
|
| 456 |
+
"model.layers.42.post_attention_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 457 |
+
"model.layers.42.self_attn.k_proj.bias": "model-00005-of-00006.safetensors",
|
| 458 |
+
"model.layers.42.self_attn.k_proj.weight": "model-00005-of-00006.safetensors",
|
| 459 |
+
"model.layers.42.self_attn.o_proj.weight": "model-00005-of-00006.safetensors",
|
| 460 |
+
"model.layers.42.self_attn.q_proj.bias": "model-00005-of-00006.safetensors",
|
| 461 |
+
"model.layers.42.self_attn.q_proj.weight": "model-00005-of-00006.safetensors",
|
| 462 |
+
"model.layers.42.self_attn.v_proj.bias": "model-00005-of-00006.safetensors",
|
| 463 |
+
"model.layers.42.self_attn.v_proj.weight": "model-00005-of-00006.safetensors",
|
| 464 |
+
"model.layers.43.input_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 465 |
+
"model.layers.43.mlp.down_proj.weight": "model-00006-of-00006.safetensors",
|
| 466 |
+
"model.layers.43.mlp.gate_proj.weight": "model-00006-of-00006.safetensors",
|
| 467 |
+
"model.layers.43.mlp.up_proj.weight": "model-00006-of-00006.safetensors",
|
| 468 |
+
"model.layers.43.post_attention_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 469 |
+
"model.layers.43.self_attn.k_proj.bias": "model-00006-of-00006.safetensors",
|
| 470 |
+
"model.layers.43.self_attn.k_proj.weight": "model-00006-of-00006.safetensors",
|
| 471 |
+
"model.layers.43.self_attn.o_proj.weight": "model-00006-of-00006.safetensors",
|
| 472 |
+
"model.layers.43.self_attn.q_proj.bias": "model-00006-of-00006.safetensors",
|
| 473 |
+
"model.layers.43.self_attn.q_proj.weight": "model-00006-of-00006.safetensors",
|
| 474 |
+
"model.layers.43.self_attn.v_proj.bias": "model-00006-of-00006.safetensors",
|
| 475 |
+
"model.layers.43.self_attn.v_proj.weight": "model-00006-of-00006.safetensors",
|
| 476 |
+
"model.layers.44.input_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 477 |
+
"model.layers.44.mlp.down_proj.weight": "model-00006-of-00006.safetensors",
|
| 478 |
+
"model.layers.44.mlp.gate_proj.weight": "model-00006-of-00006.safetensors",
|
| 479 |
+
"model.layers.44.mlp.up_proj.weight": "model-00006-of-00006.safetensors",
|
| 480 |
+
"model.layers.44.post_attention_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 481 |
+
"model.layers.44.self_attn.k_proj.bias": "model-00006-of-00006.safetensors",
|
| 482 |
+
"model.layers.44.self_attn.k_proj.weight": "model-00006-of-00006.safetensors",
|
| 483 |
+
"model.layers.44.self_attn.o_proj.weight": "model-00006-of-00006.safetensors",
|
| 484 |
+
"model.layers.44.self_attn.q_proj.bias": "model-00006-of-00006.safetensors",
|
| 485 |
+
"model.layers.44.self_attn.q_proj.weight": "model-00006-of-00006.safetensors",
|
| 486 |
+
"model.layers.44.self_attn.v_proj.bias": "model-00006-of-00006.safetensors",
|
| 487 |
+
"model.layers.44.self_attn.v_proj.weight": "model-00006-of-00006.safetensors",
|
| 488 |
+
"model.layers.45.input_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 489 |
+
"model.layers.45.mlp.down_proj.weight": "model-00006-of-00006.safetensors",
|
| 490 |
+
"model.layers.45.mlp.gate_proj.weight": "model-00006-of-00006.safetensors",
|
| 491 |
+
"model.layers.45.mlp.up_proj.weight": "model-00006-of-00006.safetensors",
|
| 492 |
+
"model.layers.45.post_attention_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 493 |
+
"model.layers.45.self_attn.k_proj.bias": "model-00006-of-00006.safetensors",
|
| 494 |
+
"model.layers.45.self_attn.k_proj.weight": "model-00006-of-00006.safetensors",
|
| 495 |
+
"model.layers.45.self_attn.o_proj.weight": "model-00006-of-00006.safetensors",
|
| 496 |
+
"model.layers.45.self_attn.q_proj.bias": "model-00006-of-00006.safetensors",
|
| 497 |
+
"model.layers.45.self_attn.q_proj.weight": "model-00006-of-00006.safetensors",
|
| 498 |
+
"model.layers.45.self_attn.v_proj.bias": "model-00006-of-00006.safetensors",
|
| 499 |
+
"model.layers.45.self_attn.v_proj.weight": "model-00006-of-00006.safetensors",
|
| 500 |
+
"model.layers.46.input_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 501 |
+
"model.layers.46.mlp.down_proj.weight": "model-00006-of-00006.safetensors",
|
| 502 |
+
"model.layers.46.mlp.gate_proj.weight": "model-00006-of-00006.safetensors",
|
| 503 |
+
"model.layers.46.mlp.up_proj.weight": "model-00006-of-00006.safetensors",
|
| 504 |
+
"model.layers.46.post_attention_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 505 |
+
"model.layers.46.self_attn.k_proj.bias": "model-00006-of-00006.safetensors",
|
| 506 |
+
"model.layers.46.self_attn.k_proj.weight": "model-00006-of-00006.safetensors",
|
| 507 |
+
"model.layers.46.self_attn.o_proj.weight": "model-00006-of-00006.safetensors",
|
| 508 |
+
"model.layers.46.self_attn.q_proj.bias": "model-00006-of-00006.safetensors",
|
| 509 |
+
"model.layers.46.self_attn.q_proj.weight": "model-00006-of-00006.safetensors",
|
| 510 |
+
"model.layers.46.self_attn.v_proj.bias": "model-00006-of-00006.safetensors",
|
| 511 |
+
"model.layers.46.self_attn.v_proj.weight": "model-00006-of-00006.safetensors",
|
| 512 |
+
"model.layers.47.input_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 513 |
+
"model.layers.47.mlp.down_proj.weight": "model-00006-of-00006.safetensors",
|
| 514 |
+
"model.layers.47.mlp.gate_proj.weight": "model-00006-of-00006.safetensors",
|
| 515 |
+
"model.layers.47.mlp.up_proj.weight": "model-00006-of-00006.safetensors",
|
| 516 |
+
"model.layers.47.post_attention_layernorm.weight": "model-00006-of-00006.safetensors",
|
| 517 |
+
"model.layers.47.self_attn.k_proj.bias": "model-00006-of-00006.safetensors",
|
| 518 |
+
"model.layers.47.self_attn.k_proj.weight": "model-00006-of-00006.safetensors",
|
| 519 |
+
"model.layers.47.self_attn.o_proj.weight": "model-00006-of-00006.safetensors",
|
| 520 |
+
"model.layers.47.self_attn.q_proj.bias": "model-00006-of-00006.safetensors",
|
| 521 |
+
"model.layers.47.self_attn.q_proj.weight": "model-00006-of-00006.safetensors",
|
| 522 |
+
"model.layers.47.self_attn.v_proj.bias": "model-00006-of-00006.safetensors",
|
| 523 |
+
"model.layers.47.self_attn.v_proj.weight": "model-00006-of-00006.safetensors",
|
| 524 |
+
"model.layers.5.input_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 525 |
+
"model.layers.5.mlp.down_proj.weight": "model-00001-of-00006.safetensors",
|
| 526 |
+
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-00006.safetensors",
|
| 527 |
+
"model.layers.5.mlp.up_proj.weight": "model-00001-of-00006.safetensors",
|
| 528 |
+
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00006.safetensors",
|
| 529 |
+
"model.layers.5.self_attn.k_proj.bias": "model-00001-of-00006.safetensors",
|
| 530 |
+
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00006.safetensors",
|
| 531 |
+
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00006.safetensors",
|
| 532 |
+
"model.layers.5.self_attn.q_proj.bias": "model-00001-of-00006.safetensors",
|
| 533 |
+
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00006.safetensors",
|
| 534 |
+
"model.layers.5.self_attn.v_proj.bias": "model-00001-of-00006.safetensors",
|
| 535 |
+
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00006.safetensors",
|
| 536 |
+
"model.layers.6.input_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 537 |
+
"model.layers.6.mlp.down_proj.weight": "model-00002-of-00006.safetensors",
|
| 538 |
+
"model.layers.6.mlp.gate_proj.weight": "model-00002-of-00006.safetensors",
|
| 539 |
+
"model.layers.6.mlp.up_proj.weight": "model-00002-of-00006.safetensors",
|
| 540 |
+
"model.layers.6.post_attention_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 541 |
+
"model.layers.6.self_attn.k_proj.bias": "model-00001-of-00006.safetensors",
|
| 542 |
+
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00006.safetensors",
|
| 543 |
+
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00006.safetensors",
|
| 544 |
+
"model.layers.6.self_attn.q_proj.bias": "model-00001-of-00006.safetensors",
|
| 545 |
+
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00006.safetensors",
|
| 546 |
+
"model.layers.6.self_attn.v_proj.bias": "model-00001-of-00006.safetensors",
|
| 547 |
+
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00006.safetensors",
|
| 548 |
+
"model.layers.7.input_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 549 |
+
"model.layers.7.mlp.down_proj.weight": "model-00002-of-00006.safetensors",
|
| 550 |
+
"model.layers.7.mlp.gate_proj.weight": "model-00002-of-00006.safetensors",
|
| 551 |
+
"model.layers.7.mlp.up_proj.weight": "model-00002-of-00006.safetensors",
|
| 552 |
+
"model.layers.7.post_attention_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 553 |
+
"model.layers.7.self_attn.k_proj.bias": "model-00002-of-00006.safetensors",
|
| 554 |
+
"model.layers.7.self_attn.k_proj.weight": "model-00002-of-00006.safetensors",
|
| 555 |
+
"model.layers.7.self_attn.o_proj.weight": "model-00002-of-00006.safetensors",
|
| 556 |
+
"model.layers.7.self_attn.q_proj.bias": "model-00002-of-00006.safetensors",
|
| 557 |
+
"model.layers.7.self_attn.q_proj.weight": "model-00002-of-00006.safetensors",
|
| 558 |
+
"model.layers.7.self_attn.v_proj.bias": "model-00002-of-00006.safetensors",
|
| 559 |
+
"model.layers.7.self_attn.v_proj.weight": "model-00002-of-00006.safetensors",
|
| 560 |
+
"model.layers.8.input_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 561 |
+
"model.layers.8.mlp.down_proj.weight": "model-00002-of-00006.safetensors",
|
| 562 |
+
"model.layers.8.mlp.gate_proj.weight": "model-00002-of-00006.safetensors",
|
| 563 |
+
"model.layers.8.mlp.up_proj.weight": "model-00002-of-00006.safetensors",
|
| 564 |
+
"model.layers.8.post_attention_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 565 |
+
"model.layers.8.self_attn.k_proj.bias": "model-00002-of-00006.safetensors",
|
| 566 |
+
"model.layers.8.self_attn.k_proj.weight": "model-00002-of-00006.safetensors",
|
| 567 |
+
"model.layers.8.self_attn.o_proj.weight": "model-00002-of-00006.safetensors",
|
| 568 |
+
"model.layers.8.self_attn.q_proj.bias": "model-00002-of-00006.safetensors",
|
| 569 |
+
"model.layers.8.self_attn.q_proj.weight": "model-00002-of-00006.safetensors",
|
| 570 |
+
"model.layers.8.self_attn.v_proj.bias": "model-00002-of-00006.safetensors",
|
| 571 |
+
"model.layers.8.self_attn.v_proj.weight": "model-00002-of-00006.safetensors",
|
| 572 |
+
"model.layers.9.input_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 573 |
+
"model.layers.9.mlp.down_proj.weight": "model-00002-of-00006.safetensors",
|
| 574 |
+
"model.layers.9.mlp.gate_proj.weight": "model-00002-of-00006.safetensors",
|
| 575 |
+
"model.layers.9.mlp.up_proj.weight": "model-00002-of-00006.safetensors",
|
| 576 |
+
"model.layers.9.post_attention_layernorm.weight": "model-00002-of-00006.safetensors",
|
| 577 |
+
"model.layers.9.self_attn.k_proj.bias": "model-00002-of-00006.safetensors",
|
| 578 |
+
"model.layers.9.self_attn.k_proj.weight": "model-00002-of-00006.safetensors",
|
| 579 |
+
"model.layers.9.self_attn.o_proj.weight": "model-00002-of-00006.safetensors",
|
| 580 |
+
"model.layers.9.self_attn.q_proj.bias": "model-00002-of-00006.safetensors",
|
| 581 |
+
"model.layers.9.self_attn.q_proj.weight": "model-00002-of-00006.safetensors",
|
| 582 |
+
"model.layers.9.self_attn.v_proj.bias": "model-00002-of-00006.safetensors",
|
| 583 |
+
"model.layers.9.self_attn.v_proj.weight": "model-00002-of-00006.safetensors",
|
| 584 |
+
"model.norm.weight": "model-00006-of-00006.safetensors"
|
| 585 |
+
}
|
| 586 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<|im_start|>",
|
| 4 |
+
"<|im_end|>",
|
| 5 |
+
"<|object_ref_start|>",
|
| 6 |
+
"<|object_ref_end|>",
|
| 7 |
+
"<|box_start|>",
|
| 8 |
+
"<|box_end|>",
|
| 9 |
+
"<|quad_start|>",
|
| 10 |
+
"<|quad_end|>",
|
| 11 |
+
"<|vision_start|>",
|
| 12 |
+
"<|vision_end|>",
|
| 13 |
+
"<|vision_pad|>",
|
| 14 |
+
"<|image_pad|>",
|
| 15 |
+
"<|video_pad|>"
|
| 16 |
+
],
|
| 17 |
+
"eos_token": {
|
| 18 |
+
"content": "<|im_end|>",
|
| 19 |
+
"lstrip": false,
|
| 20 |
+
"normalized": false,
|
| 21 |
+
"rstrip": false,
|
| 22 |
+
"single_word": false
|
| 23 |
+
},
|
| 24 |
+
"pad_token": {
|
| 25 |
+
"content": "<|vision_pad|>",
|
| 26 |
+
"lstrip": false,
|
| 27 |
+
"normalized": false,
|
| 28 |
+
"rstrip": false,
|
| 29 |
+
"single_word": false
|
| 30 |
+
}
|
| 31 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9c5ae00e602b8860cbd784ba82a8aa14e8feecec692e7076590d014d7b7fdafa
|
| 3 |
+
size 11421896
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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endoftext|>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false,
|
| 11 |
+
"special": true
|
| 12 |
+
},
|
| 13 |
+
"151644": {
|
| 14 |
+
"content": "<|im_start|>",
|
| 15 |
+
"lstrip": false,
|
| 16 |
+
"normalized": false,
|
| 17 |
+
"rstrip": false,
|
| 18 |
+
"single_word": false,
|
| 19 |
+
"special": true
|
| 20 |
+
},
|
| 21 |
+
"151645": {
|
| 22 |
+
"content": "<|im_end|>",
|
| 23 |
+
"lstrip": false,
|
| 24 |
+
"normalized": false,
|
| 25 |
+
"rstrip": false,
|
| 26 |
+
"single_word": false,
|
| 27 |
+
"special": true
|
| 28 |
+
},
|
| 29 |
+
"151646": {
|
| 30 |
+
"content": "<|object_ref_start|>",
|
| 31 |
+
"lstrip": false,
|
| 32 |
+
"normalized": false,
|
| 33 |
+
"rstrip": false,
|
| 34 |
+
"single_word": false,
|
| 35 |
+
"special": true
|
| 36 |
+
},
|
| 37 |
+
"151647": {
|
| 38 |
+
"content": "<|object_ref_end|>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": false,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false,
|
| 43 |
+
"special": true
|
| 44 |
+
},
|
| 45 |
+
"151648": {
|
| 46 |
+
"content": "<|box_start|>",
|
| 47 |
+
"lstrip": false,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"rstrip": false,
|
| 50 |
+
"single_word": false,
|
| 51 |
+
"special": true
|
| 52 |
+
},
|
| 53 |
+
"151649": {
|
| 54 |
+
"content": "<|box_end|>",
|
| 55 |
+
"lstrip": false,
|
| 56 |
+
"normalized": false,
|
| 57 |
+
"rstrip": false,
|
| 58 |
+
"single_word": false,
|
| 59 |
+
"special": true
|
| 60 |
+
},
|
| 61 |
+
"151650": {
|
| 62 |
+
"content": "<|quad_start|>",
|
| 63 |
+
"lstrip": false,
|
| 64 |
+
"normalized": false,
|
| 65 |
+
"rstrip": false,
|
| 66 |
+
"single_word": false,
|
| 67 |
+
"special": true
|
| 68 |
+
},
|
| 69 |
+
"151651": {
|
| 70 |
+
"content": "<|quad_end|>",
|
| 71 |
+
"lstrip": false,
|
| 72 |
+
"normalized": false,
|
| 73 |
+
"rstrip": false,
|
| 74 |
+
"single_word": false,
|
| 75 |
+
"special": true
|
| 76 |
+
},
|
| 77 |
+
"151652": {
|
| 78 |
+
"content": "<|vision_start|>",
|
| 79 |
+
"lstrip": false,
|
| 80 |
+
"normalized": false,
|
| 81 |
+
"rstrip": false,
|
| 82 |
+
"single_word": false,
|
| 83 |
+
"special": true
|
| 84 |
+
},
|
| 85 |
+
"151653": {
|
| 86 |
+
"content": "<|vision_end|>",
|
| 87 |
+
"lstrip": false,
|
| 88 |
+
"normalized": false,
|
| 89 |
+
"rstrip": false,
|
| 90 |
+
"single_word": false,
|
| 91 |
+
"special": true
|
| 92 |
+
},
|
| 93 |
+
"151654": {
|
| 94 |
+
"content": "<|vision_pad|>",
|
| 95 |
+
"lstrip": false,
|
| 96 |
+
"normalized": false,
|
| 97 |
+
"rstrip": false,
|
| 98 |
+
"single_word": false,
|
| 99 |
+
"special": true
|
| 100 |
+
},
|
| 101 |
+
"151655": {
|
| 102 |
+
"content": "<|image_pad|>",
|
| 103 |
+
"lstrip": false,
|
| 104 |
+
"normalized": false,
|
| 105 |
+
"rstrip": false,
|
| 106 |
+
"single_word": false,
|
| 107 |
+
"special": true
|
| 108 |
+
},
|
| 109 |
+
"151656": {
|
| 110 |
+
"content": "<|video_pad|>",
|
| 111 |
+
"lstrip": false,
|
| 112 |
+
"normalized": false,
|
| 113 |
+
"rstrip": false,
|
| 114 |
+
"single_word": false,
|
| 115 |
+
"special": true
|
| 116 |
+
},
|
| 117 |
+
"151657": {
|
| 118 |
+
"content": "<tool_call>",
|
| 119 |
+
"lstrip": false,
|
| 120 |
+
"normalized": false,
|
| 121 |
+
"rstrip": false,
|
| 122 |
+
"single_word": false,
|
| 123 |
+
"special": false
|
| 124 |
+
},
|
| 125 |
+
"151658": {
|
| 126 |
+
"content": "</tool_call>",
|
| 127 |
+
"lstrip": false,
|
| 128 |
+
"normalized": false,
|
| 129 |
+
"rstrip": false,
|
| 130 |
+
"single_word": false,
|
| 131 |
+
"special": false
|
| 132 |
+
},
|
| 133 |
+
"151659": {
|
| 134 |
+
"content": "<|fim_prefix|>",
|
| 135 |
+
"lstrip": false,
|
| 136 |
+
"normalized": false,
|
| 137 |
+
"rstrip": false,
|
| 138 |
+
"single_word": false,
|
| 139 |
+
"special": false
|
| 140 |
+
},
|
| 141 |
+
"151660": {
|
| 142 |
+
"content": "<|fim_middle|>",
|
| 143 |
+
"lstrip": false,
|
| 144 |
+
"normalized": false,
|
| 145 |
+
"rstrip": false,
|
| 146 |
+
"single_word": false,
|
| 147 |
+
"special": false
|
| 148 |
+
},
|
| 149 |
+
"151661": {
|
| 150 |
+
"content": "<|fim_suffix|>",
|
| 151 |
+
"lstrip": false,
|
| 152 |
+
"normalized": false,
|
| 153 |
+
"rstrip": false,
|
| 154 |
+
"single_word": false,
|
| 155 |
+
"special": false
|
| 156 |
+
},
|
| 157 |
+
"151662": {
|
| 158 |
+
"content": "<|fim_pad|>",
|
| 159 |
+
"lstrip": false,
|
| 160 |
+
"normalized": false,
|
| 161 |
+
"rstrip": false,
|
| 162 |
+
"single_word": false,
|
| 163 |
+
"special": false
|
| 164 |
+
},
|
| 165 |
+
"151663": {
|
| 166 |
+
"content": "<|repo_name|>",
|
| 167 |
+
"lstrip": false,
|
| 168 |
+
"normalized": false,
|
| 169 |
+
"rstrip": false,
|
| 170 |
+
"single_word": false,
|
| 171 |
+
"special": false
|
| 172 |
+
},
|
| 173 |
+
"151664": {
|
| 174 |
+
"content": "<|file_sep|>",
|
| 175 |
+
"lstrip": false,
|
| 176 |
+
"normalized": false,
|
| 177 |
+
"rstrip": false,
|
| 178 |
+
"single_word": false,
|
| 179 |
+
"special": false
|
| 180 |
+
}
|
| 181 |
+
},
|
| 182 |
+
"additional_special_tokens": [
|
| 183 |
+
"<|im_start|>",
|
| 184 |
+
"<|im_end|>",
|
| 185 |
+
"<|object_ref_start|>",
|
| 186 |
+
"<|object_ref_end|>",
|
| 187 |
+
"<|box_start|>",
|
| 188 |
+
"<|box_end|>",
|
| 189 |
+
"<|quad_start|>",
|
| 190 |
+
"<|quad_end|>",
|
| 191 |
+
"<|vision_start|>",
|
| 192 |
+
"<|vision_end|>",
|
| 193 |
+
"<|vision_pad|>",
|
| 194 |
+
"<|image_pad|>",
|
| 195 |
+
"<|video_pad|>"
|
| 196 |
+
],
|
| 197 |
+
"bos_token": null,
|
| 198 |
+
"clean_up_tokenization_spaces": false,
|
| 199 |
+
"eos_token": "<|im_end|>",
|
| 200 |
+
"errors": "replace",
|
| 201 |
+
"extra_special_tokens": {},
|
| 202 |
+
"model_max_length": 32768,
|
| 203 |
+
"pad_token": "<|vision_pad|>",
|
| 204 |
+
"padding_side": "right",
|
| 205 |
+
"split_special_tokens": false,
|
| 206 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 207 |
+
"unk_token": null,
|
| 208 |
+
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n"
|
| 209 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|