Text Generation
PEFT
Safetensors
Transformers
qwen2
lora
coding
code-generation
conversational
text-generation-inference
Instructions to use girish00/ConicAI_LLM_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use girish00/ConicAI_LLM_model with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-0.5B-Instruct") model = PeftModel.from_pretrained(base_model, "girish00/ConicAI_LLM_model") - Transformers
How to use girish00/ConicAI_LLM_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="girish00/ConicAI_LLM_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("girish00/ConicAI_LLM_model") model = AutoModelForCausalLM.from_pretrained("girish00/ConicAI_LLM_model") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use girish00/ConicAI_LLM_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "girish00/ConicAI_LLM_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "girish00/ConicAI_LLM_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/girish00/ConicAI_LLM_model
- SGLang
How to use girish00/ConicAI_LLM_model with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "girish00/ConicAI_LLM_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "girish00/ConicAI_LLM_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "girish00/ConicAI_LLM_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "girish00/ConicAI_LLM_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use girish00/ConicAI_LLM_model with Docker Model Runner:
docker model run hf.co/girish00/ConicAI_LLM_model
update readme file from readme_22_04_26.md
Browse files
README.md
CHANGED
|
@@ -1,263 +1,303 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
| 3 |
-
base_model: Qwen/Qwen2.5-Coder-0.5B-Instruct
|
| 4 |
library_name: peft
|
| 5 |
pipeline_tag: text-generation
|
|
|
|
| 6 |
tags:
|
| 7 |
-
- code
|
| 8 |
- lora
|
| 9 |
-
-
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
python finetune_coding_llm_colab.py --dataset-size 5000 --max-train-samples 200 --epochs 0.1
|
| 63 |
-
```
|
| 64 |
-
|
| 65 |
-
Single command pipeline (no upload):
|
| 66 |
-
|
| 67 |
-
```bash
|
| 68 |
-
python run_pipeline.py --dataset-size 8000 --skip-upload
|
| 69 |
-
```
|
| 70 |
-
|
| 71 |
-
If `training_config.json` exists, `run_pipeline.py` reads it automatically for defaults.
|
| 72 |
-
|
| 73 |
-
Use existing dataset without regenerating:
|
| 74 |
-
|
| 75 |
-
```bash
|
| 76 |
-
python run_pipeline.py --dataset-size 8000 --train-file train.json --skip-generate --skip-upload
|
| 77 |
-
```
|
| 78 |
-
|
| 79 |
-
Tunable training knobs:
|
| 80 |
-
|
| 81 |
-
```bash
|
| 82 |
-
python run_pipeline.py --dataset-size 8000 --epochs 3 --batch-size 2 --learning-rate 1e-4 --max-length 512 --max-train-samples 0 --use-4bit --skip-upload
|
| 83 |
-
```
|
| 84 |
-
|
| 85 |
-
## Configure 5k-10k samples
|
| 86 |
-
|
| 87 |
-
```python
|
| 88 |
-
--dataset-size 5000
|
| 89 |
-
--dataset-size 8000
|
| 90 |
-
--dataset-size 10000
|
| 91 |
-
```
|
| 92 |
-
|
| 93 |
-
Recommended values:
|
| 94 |
-
- 5000 for fast iteration
|
| 95 |
-
- 8000 as balanced
|
| 96 |
-
- 10000 for stronger adaptation (slower)
|
| 97 |
-
|
| 98 |
-
## Hugging Face Deployment
|
| 99 |
-
|
| 100 |
-
Upload is optional and can be done after training:
|
| 101 |
-
|
| 102 |
-
```bash
|
| 103 |
-
python upload_to_hf.py --model-dir model --repo-id your-username/your-model-name
|
| 104 |
-
```
|
| 105 |
-
|
| 106 |
-
### Update Existing HF Model Repo
|
| 107 |
-
|
| 108 |
-
To update your already-created Hugging Face model with this new JSON-output behavior:
|
| 109 |
-
|
| 110 |
-
1. Retrain locally with latest code:
|
| 111 |
-
```bash
|
| 112 |
-
python run_pipeline.py --dataset-size 8000 --skip-upload
|
| 113 |
-
```
|
| 114 |
-
|
| 115 |
-
2. Login to Hugging Face:
|
| 116 |
-
```bash
|
| 117 |
-
huggingface-cli login
|
| 118 |
-
```
|
| 119 |
-
|
| 120 |
-
3. Upload to the same repo ID (this updates existing files):
|
| 121 |
-
```bash
|
| 122 |
-
python upload_to_hf.py --model-dir model --repo-id your-username/your-existing-model-name
|
| 123 |
-
```
|
| 124 |
-
|
| 125 |
-
Optional safer rollout using a new revision/branch:
|
| 126 |
-
```bash
|
| 127 |
-
python -c "from huggingface_hub import upload_folder; upload_folder(folder_path='model', repo_id='your-username/your-existing-model-name', repo_type='model', revision='v2-json-output')"
|
| 128 |
-
```
|
| 129 |
-
|
| 130 |
-
You can also trigger upload from trainer:
|
| 131 |
-
|
| 132 |
-
```bash
|
| 133 |
-
python finetune_coding_llm_colab.py --skip-dataset-gen --skip-train --upload --hf-repo your-username/your-model-name
|
| 134 |
-
```
|
| 135 |
-
|
| 136 |
-
## Quick Inference Test (Structured JSON)
|
| 137 |
-
|
| 138 |
-
After local training, inference returns JSON with:
|
| 139 |
-
- `code`
|
| 140 |
-
- `explanation`
|
| 141 |
-
- `confidence`
|
| 142 |
-
- `important_tokens`
|
| 143 |
-
- `relevancy_score`
|
| 144 |
-
- `hallucination`
|
| 145 |
-
- `hallucination_check_reason`
|
| 146 |
-
- `latency_ms`
|
| 147 |
-
|
| 148 |
-
```python
|
| 149 |
-
python infer_local.py --model-path model --prompt "Fix this code: def add(a,b) return a+b"
|
| 150 |
-
```
|
| 151 |
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
-
```bash
|
| 155 |
-
python infer_local.py --model-path model --prompt "Fix this code: def add(a,b) return a+b" --allow-downloads
|
| 156 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
|
| 158 |
-
|
|
|
|
|
|
|
| 159 |
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
```
|
|
|
|
| 164 |
|
| 165 |
-
If `infer_cloud.py` falls back to local inference on a new machine that has not cached the base model yet, add `--allow-downloads`.
|
| 166 |
|
| 167 |
-
|
| 168 |
|
| 169 |
-
```
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
-
|
| 175 |
|
| 176 |
-
|
|
|
|
| 177 |
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
```
|
| 182 |
|
| 183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
```
|
| 190 |
|
| 191 |
-
|
| 192 |
|
| 193 |
-
|
| 194 |
|
| 195 |
-
###
|
| 196 |
|
| 197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
| 210 |
```
|
| 211 |
|
| 212 |
-
|
|
|
|
|
|
|
| 213 |
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
-ContentType "application/json" `
|
| 221 |
-
-Body '{"inputs":"Fix this code: def add(a,b) return a+b","parameters":{"max_new_tokens":320}}'
|
| 222 |
-
```
|
| 223 |
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
Explicit base model for LoRA adapter loading:
|
| 227 |
-
|
| 228 |
-
```python
|
| 229 |
-
python infer_local.py --model-path model --base-model Qwen/Qwen2.5-Coder-0.5B-Instruct --prompt "Fix this code: def add(a,b) return a+b"
|
| 230 |
-
```
|
| 231 |
-
|
| 232 |
-
`infer_local.py` automatically handles both:
|
| 233 |
-
- LoRA adapter output folders
|
| 234 |
-
- Fully merged/full-model output folders
|
| 235 |
-
|
| 236 |
-
## Accuracy Evaluation
|
| 237 |
-
|
| 238 |
-
Run default evaluation prompts:
|
| 239 |
-
|
| 240 |
-
```bash
|
| 241 |
-
python evaluate_model.py --model-path model
|
| 242 |
-
```
|
| 243 |
-
|
| 244 |
-
Run with custom prompts:
|
| 245 |
-
|
| 246 |
-
```bash
|
| 247 |
-
python evaluate_model.py --model-path model --prompt "Fix this code: if x = 5: print(x)" --prompt "Write python code for linear regression and explain it"
|
| 248 |
-
```
|
| 249 |
-
|
| 250 |
-
For higher quality output:
|
| 251 |
-
- use dataset size `8000` or `10000`
|
| 252 |
-
- use `epochs >= 3`
|
| 253 |
-
- prefer `--use-4bit` when GPU is available
|
| 254 |
-
- keep prompts specific and task-focused
|
| 255 |
-
|
| 256 |
-
## Recommended Run Order
|
| 257 |
-
|
| 258 |
-
```bash
|
| 259 |
-
python run_pipeline.py --dataset-size 8000 --skip-upload
|
| 260 |
-
python infer_local.py --model-path model --prompt "Fix this code: def add(a,b) return a+b"
|
| 261 |
-
python evaluate_model.py --model-path model
|
| 262 |
-
python upload_to_hf.py --model-dir model --repo-id your-username/your-existing-model-name
|
| 263 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: "Qwen/Qwen2.5-Coder-0.5B-Instruct"
|
| 4 |
library_name: peft
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
+
|
| 7 |
tags:
|
|
|
|
| 8 |
- lora
|
| 9 |
+
- transformers
|
| 10 |
+
- coding
|
| 11 |
+
- code-generation
|
| 12 |
+
- peft
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# ConicAI Coding LLM
|
| 16 |
+
|
| 17 |
+
## Model Details
|
| 18 |
+
|
| 19 |
+
### Model Description
|
| 20 |
+
|
| 21 |
+
ConicAI LLM Model is a parameter-efficient fine-tuned coding assistant built using LoRA on top of Qwen2.5-Coder. It is designed to generate, debug, and explain code with structured outputs.
|
| 22 |
+
|
| 23 |
+
* **Developed by:** GIRISH KUMAR DEWANGAN
|
| 24 |
+
* **Model type:** Causal Language Model (Code LLM)
|
| 25 |
+
* **Language(s):** Python, general programming
|
| 26 |
+
* **used for:** Code generation, debugging, fixing error, getting evaluation score, check hallucination and relevancy score as well
|
| 27 |
+
* **License:** Apache 2.0
|
| 28 |
+
* **Finetuned from model:** Qwen/Qwen2.5-Coder-0.5B-Instruct
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## Model Sources
|
| 33 |
+
|
| 34 |
+
* **Repository:** https://huggingface.co/girish00/ConicAI_LLM_model
|
| 35 |
+
* **Paper:** Available in repo ("ConicAI_paper.md")
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## Uses
|
| 40 |
+
|
| 41 |
+
### Direct Use
|
| 42 |
+
|
| 43 |
+
* Code generation
|
| 44 |
+
* Debugging
|
| 45 |
+
* Code explanation
|
| 46 |
+
* Learning programming
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
### Downstream Use
|
| 51 |
+
|
| 52 |
+
* Coding assistants
|
| 53 |
+
* AI-based education tools
|
| 54 |
+
* Developer productivity tools
|
| 55 |
+
|
| 56 |
+
---
|
| 57 |
+
|
| 58 |
+
### Out-of-Scope Use
|
| 59 |
+
|
| 60 |
+
* Security-critical systems
|
| 61 |
+
* Autonomous production systems
|
| 62 |
+
* High-risk environments
|
| 63 |
+
|
| 64 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
+
## Bias, Risks, and Limitations
|
| 67 |
+
|
| 68 |
+
* May generate incorrect logic
|
| 69 |
+
* Confidence scores are heuristic
|
| 70 |
+
* Output depends on prompt quality
|
| 71 |
+
* Limited dataset generalization
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
## Recommendations
|
| 76 |
+
|
| 77 |
+
* Always validate generated code
|
| 78 |
+
* Use structured prompts
|
| 79 |
+
* Avoid ambiguous instructions
|
| 80 |
+
|
| 81 |
+
---
|
| 82 |
+
## Structured Output Framework
|
| 83 |
+
The model produces outputs in structured JSON format:
|
| 84 |
|
|
|
|
|
|
|
| 85 |
```
|
| 86 |
+
{
|
| 87 |
+
"code": "...",
|
| 88 |
+
"explanation": "...",
|
| 89 |
+
"confidence": 0.84,
|
| 90 |
+
"relevancy_score": 0.82,
|
| 91 |
+
"hallucination": false
|
| 92 |
+
}
|
| 93 |
|
| 94 |
+
```
|
| 95 |
+
```text
|
| 96 |
+
This enables:
|
| 97 |
|
| 98 |
+
-Easy API integration
|
| 99 |
+
-Automated evaluation
|
| 100 |
+
-Better interpretability
|
| 101 |
```
|
| 102 |
+
---
|
| 103 |
|
|
|
|
| 104 |
|
| 105 |
+
## 🚀 How to Get Started with the Model
|
| 106 |
|
| 107 |
+
```python
|
| 108 |
+
!pip -q install -U transformers peft accelerate huggingface_hub safetensors
|
| 109 |
+
!pip install --upgrade torchao
|
| 110 |
+
|
| 111 |
+
from google.colab import userdata
|
| 112 |
+
HF_TOKEN = userdata.get('HF_TOKEN')
|
| 113 |
+
|
| 114 |
+
model = "girish00/ConicAI_LLM_model"
|
| 115 |
+
prompt = input("Enter your prompt: ")
|
| 116 |
+
|
| 117 |
+
from huggingface_hub import login, snapshot_download
|
| 118 |
+
login(token=HF_TOKEN)
|
| 119 |
+
|
| 120 |
+
repo = snapshot_download(model, token=HF_TOKEN)
|
| 121 |
+
|
| 122 |
+
import sys, os
|
| 123 |
+
sys.path.append(repo)
|
| 124 |
+
|
| 125 |
+
from infer_local import build_instruction_prompt, build_structured_result
|
| 126 |
+
from peft import PeftConfig, PeftModel
|
| 127 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 128 |
+
import torch, time, json
|
| 129 |
+
|
| 130 |
+
cfg = PeftConfig.from_pretrained(repo)
|
| 131 |
+
base = cfg.base_model_name_or_path
|
| 132 |
+
|
| 133 |
+
tokenizer = AutoTokenizer.from_pretrained(base)
|
| 134 |
+
|
| 135 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 136 |
+
base,
|
| 137 |
+
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
| 138 |
+
device_map="auto"
|
| 139 |
+
)
|
| 140 |
+
|
| 141 |
+
llm = PeftModel.from_pretrained(base_model, repo)
|
| 142 |
+
llm.eval()
|
| 143 |
+
|
| 144 |
+
inputs = tokenizer(build_instruction_prompt(prompt), return_tensors="pt").to(llm.device)
|
| 145 |
+
|
| 146 |
+
start = time.perf_counter()
|
| 147 |
+
|
| 148 |
+
with torch.no_grad():
|
| 149 |
+
out = llm.generate(
|
| 150 |
+
**inputs,
|
| 151 |
+
max_new_tokens=320,
|
| 152 |
+
output_scores=True,
|
| 153 |
+
return_dict_in_generate=True,
|
| 154 |
+
do_sample=False,
|
| 155 |
+
pad_token_id=tokenizer.eos_token_id
|
| 156 |
+
)
|
| 157 |
|
| 158 |
+
latency = int((time.perf_counter() - start) * 1000)
|
| 159 |
|
| 160 |
+
gen_ids = out.sequences[0][inputs["input_ids"].shape[1]:].tolist()
|
| 161 |
+
text = tokenizer.decode(gen_ids, skip_special_tokens=True)
|
| 162 |
|
| 163 |
+
conf = []
|
| 164 |
+
for tid, score in zip(gen_ids, out.scores):
|
| 165 |
+
probs = torch.softmax(score[0], dim=-1)
|
| 166 |
+
conf.append(float(probs[tid].item()))
|
| 167 |
+
|
| 168 |
+
print(json.dumps(
|
| 169 |
+
build_structured_result(
|
| 170 |
+
prompt,
|
| 171 |
+
text,
|
| 172 |
+
latency,
|
| 173 |
+
tokenizer=tokenizer,
|
| 174 |
+
generated_ids=gen_ids,
|
| 175 |
+
token_confidences=conf
|
| 176 |
+
),
|
| 177 |
+
indent=2
|
| 178 |
+
))
|
| 179 |
```
|
| 180 |
|
| 181 |
+
---
|
| 182 |
+
|
| 183 |
+
## 📊 Benchmark Results
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
|
| 187 |
+
---
|
| 188 |
+
|
| 189 |
+
## Training Details
|
| 190 |
+
|
| 191 |
+
### Dataset
|
| 192 |
+
|
| 193 |
+
* Size: ~5K samples
|
| 194 |
+
* Instruction-based coding dataset
|
| 195 |
+
|
| 196 |
+
### Training Procedure
|
| 197 |
+
|
| 198 |
+
* Method: LoRA fine-tuning
|
| 199 |
+
* Framework: Transformers + PEFT
|
| 200 |
+
* Precision: FP16 / Mixed
|
| 201 |
+
|
| 202 |
+
### Training Hyperparameters
|
| 203 |
+
|
| 204 |
+
| Parameter | Value |
|
| 205 |
+
| ------------------- | ----- |
|
| 206 |
+
| Epochs | 1–3 |
|
| 207 |
+
| Batch Size | 2 |
|
| 208 |
+
| Learning Rate | 2e-4 |
|
| 209 |
+
| Max Sequence Length | 512 |
|
| 210 |
+
| LoRA Rank (r) | 8 |
|
| 211 |
+
| LoRA Alpha | 16 |
|
| 212 |
+
| LoRA Dropout | 0.05 |
|
| 213 |
|
| 214 |
+
---
|
| 215 |
+
|
| 216 |
+
## Inference Configuration
|
| 217 |
+
|
| 218 |
+
```text
|
| 219 |
+
max_new_tokens = 200
|
| 220 |
+
temperature = 0.2
|
| 221 |
+
top_p = 0.9
|
| 222 |
+
do_sample = True
|
| 223 |
```
|
| 224 |
|
| 225 |
+
---
|
| 226 |
|
| 227 |
+
## Evaluation
|
| 228 |
|
| 229 |
+
### Metrics
|
| 230 |
|
| 231 |
+
* Code correctness
|
| 232 |
+
* Syntax validity
|
| 233 |
+
* Relevancy score
|
| 234 |
+
* Hallucination rate
|
| 235 |
+
* Confidence score
|
| 236 |
+
* Latency
|
| 237 |
|
| 238 |
+
---
|
| 239 |
+
|
| 240 |
+
### Results Summary
|
| 241 |
+
|
| 242 |
+
* Higher correctness vs base model
|
| 243 |
+
* Lower hallucination rate
|
| 244 |
+
* Better structured outputs
|
| 245 |
+
|
| 246 |
+
---
|
| 247 |
+
|
| 248 |
+
## Technical Specifications
|
| 249 |
+
|
| 250 |
+
### Architecture
|
| 251 |
+
|
| 252 |
+
* Transformer-based causal LM
|
| 253 |
+
* LoRA adaptation
|
| 254 |
+
|
| 255 |
+
---
|
| 256 |
+
|
| 257 |
+
### Hardware
|
| 258 |
+
|
| 259 |
+
* GPU recommended (optional)
|
| 260 |
+
* CPU supported
|
| 261 |
+
|
| 262 |
+
---
|
| 263 |
+
|
| 264 |
+
### Software
|
| 265 |
+
|
| 266 |
+
* Transformers
|
| 267 |
+
* PEFT
|
| 268 |
+
* PyTorch
|
| 269 |
+
|
| 270 |
+
---
|
| 271 |
+
|
| 272 |
+
## Environmental Impact
|
| 273 |
+
|
| 274 |
+
* Low compute due to LoRA
|
| 275 |
+
* Efficient fine-tuning
|
| 276 |
+
|
| 277 |
+
---
|
| 278 |
+
|
| 279 |
+
## Citation
|
| 280 |
+
|
| 281 |
+
**BibTeX:**
|
| 282 |
+
|
| 283 |
+
```text
|
| 284 |
+
@misc{conicai_llm,
|
| 285 |
+
author = {Girish},
|
| 286 |
+
title = {ConicAI Coding LLM},
|
| 287 |
+
year = {2026},
|
| 288 |
+
publisher = {Hugging Face}
|
| 289 |
}
|
| 290 |
```
|
| 291 |
|
| 292 |
+
---
|
| 293 |
+
|
| 294 |
+
## Model Card Authors
|
| 295 |
|
| 296 |
+
GIRISH KUMAR DEWANGAN
|
| 297 |
+
|
| 298 |
+
---
|
| 299 |
+
|
| 300 |
+
|
| 301 |
+
### Framework versions
|
|
|
|
|
|
|
|
|
|
| 302 |
|
| 303 |
+
* PEFT 0.19.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|