girish00 commited on
Commit
4d657a7
·
verified ·
1 Parent(s): 99567d6

update model

Browse files
Files changed (1) hide show
  1. README.md +130 -204
README.md CHANGED
@@ -1,281 +1,207 @@
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
  tags:
7
- - code
8
- - lora
9
- - coding-assistant
10
- - structured-output
11
  ---
12
 
13
- # ConicAI Coding LLM
 
 
 
 
14
 
15
  ## Model Details
16
 
17
- * **Model Name:** ConicAI LLM Model
18
- * **Developer:** GIRISH KUMAR DEWANGAN
19
- * **Base Model:** Qwen/Qwen2.5-Coder-0.5B-Instruct
20
- * **Architecture:** Transformer (Causal LM)
21
- * **Fine-tuning Method:** LoRA (PEFT)
22
- * **Task Domain:** Code Generation, Debugging, Explanation
23
- * **Primary Language:** Python
24
 
25
- ---
26
 
27
- ## Model Description
28
 
29
- ConicAI Coding LLM is a parameter-efficient fine-tuned model optimized for structured coding tasks.
30
- It enhances the base model’s reasoning ability by introducing instruction-conditioned outputs and structured response generation.
31
 
32
- The model focuses on three key aspects:
 
 
 
 
 
 
33
 
34
- * **Accuracy** Correct code generation
35
- * **Interpretability** → Explanation + confidence
36
- * **Efficiency** → Lightweight fine-tuning
37
 
38
- ---
39
 
40
- ## Core Design Philosophy
 
 
41
 
42
- 1. **Instruction Conditioning**
43
 
44
- ```
45
- Instruction → Input → Output
46
- ```
47
 
48
- 2. **Structured Output Learning**
49
 
50
- 3. **Post-Generation Validation Awareness**
51
 
52
- ---
53
 
54
- ## Capabilities
55
 
56
- * Code generation
57
- * Code debugging
58
- * Code explanation
59
- * Structured output generation
60
- * Confidence estimation
61
- * Hallucination detection
62
 
63
- ---
64
 
65
- ## Output Schema
66
-
67
- ```json
68
- {
69
- "code": "string",
70
- "explanation": "string",
71
- "confidence": 0.0,
72
- "important_tokens": [],
73
- "relevancy_score": 0.0,
74
- "hallucination": false,
75
- "hallucination_check_reason": "",
76
- "latency_ms": 0
77
- }
78
- ```
79
 
80
- ---
81
 
82
- ## How to Use This Model (Colab / Local)
83
-
84
- ```python
85
- !pip -q install -U transformers peft accelerate huggingface_hub safetensors
86
-
87
- from google.colab import userdata
88
- HF_TOKEN = userdata.get('HF_TOKEN')
89
- model = "girish00/ConicAI_LLM_model"
90
- prompt = input("Please enter your prompt: ")
91
-
92
- from huggingface_hub import login, snapshot_download
93
- login(token=HF_TOKEN)
94
-
95
- repo = snapshot_download(model, token=HF_TOKEN)
96
-
97
- import sys
98
- sys.path.append(repo)
99
-
100
- from infer_local import build_instruction_prompt, build_structured_result
101
- from peft import PeftConfig, PeftModel
102
- from transformers import AutoTokenizer, AutoModelForCausalLM
103
- import torch, time, json
104
-
105
- cfg = PeftConfig.from_pretrained(repo)
106
- base = cfg.base_model_name_or_path
107
-
108
- tokenizer = AutoTokenizer.from_pretrained(base)
109
- base_model = AutoModelForCausalLM.from_pretrained(
110
- base,
111
- torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
112
- device_map="auto"
113
- )
114
- llm = PeftModel.from_pretrained(base_model, repo)
115
- llm.eval()
116
-
117
- inputs = tokenizer(build_instruction_prompt(prompt), return_tensors="pt").to(llm.device)
118
-
119
- start = time.perf_counter()
120
- with torch.no_grad():
121
- out = llm.generate(
122
- **inputs,
123
- max_new_tokens=320,
124
- output_scores=True,
125
- return_dict_in_generate=True,
126
- do_sample=False,
127
- pad_token_id=tokenizer.eos_token_id
128
- )
129
- latency = int((time.perf_counter() - start) * 1000)
130
-
131
- gen_ids = out.sequences[0][inputs["input_ids"].shape[1]:].tolist()
132
- text = tokenizer.decode(gen_ids, skip_special_tokens=True)
133
-
134
- conf = []
135
- for tid, score in zip(gen_ids, out.scores):
136
- probs = torch.softmax(score[0], dim=-1)
137
- conf.append(float(probs[tid].item()))
138
-
139
- print(json.dumps(
140
- build_structured_result(
141
- prompt,
142
- text,
143
- latency,
144
- tokenizer=tokenizer,
145
- generated_ids=gen_ids,
146
- token_confidences=conf
147
- ),
148
- indent=2
149
- ))
150
- ```
151
 
152
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
154
  ## Training Details
155
 
156
- ### Dataset
 
 
157
 
158
- * Size: ~5K–10K samples
159
- * Instruction-based coding dataset
160
 
161
  ### Training Procedure
162
 
163
- * Method: LoRA fine-tuning
164
- * Framework: Transformers + PEFT
165
- * Precision: FP16 / Mixed
166
 
167
- ### Training Hyperparameters
168
 
169
- | Parameter | Value |
170
- | ------------------- | ----- |
171
- | Epochs | 1–3 |
172
- | Batch Size | 2 |
173
- | Learning Rate | 2e-4 |
174
- | Max Sequence Length | 512 |
175
- | LoRA Rank (r) | 8 |
176
- | LoRA Alpha | 16 |
177
- | LoRA Dropout | 0.05 |
178
 
179
- ---
180
 
181
- ## Inference Configuration
182
 
183
- ```text
184
- max_new_tokens = 200
185
- temperature = 0.2
186
- top_p = 0.9
187
- do_sample = True
188
- ```
189
 
190
- ---
 
 
 
 
191
 
192
  ## Evaluation
193
 
194
- * Syntax validation
195
- * Prompt-based testing
196
- * Relevancy scoring
197
- * Hallucination detection
198
 
199
- ---
200
 
201
- ## Strengths
202
 
203
- * Lightweight and efficient
204
- * Strong performance on structured prompts
205
- * Generates readable and correct Python code
206
- * Provides reasoning-aware outputs
207
 
208
- ---
209
 
210
- ## Limitations
211
 
212
- * Sensitive to prompt structure
213
- * Confidence scores are heuristic
214
- * Limited generalization beyond training dataset
215
 
216
- ---
217
 
218
- ## Risks & Considerations
219
 
220
- * Always validate generated code
221
- * Not suitable for critical production systems
222
- * May produce incorrect logic
223
 
224
- ---
225
 
226
- ## Best Practices
227
 
228
- ```
229
- Instruction:
230
- Input:
231
- Output:
232
- ```
233
 
234
- * Use clear and specific prompts
235
- * Keep temperature low for reliability
236
- * Apply post-processing for cleaner output
237
 
238
- ---
239
 
240
- ## Technical Specifications
241
 
242
- * Transformer-based causal language model
243
- * LoRA adaptation on attention layers
244
- * Hugging Face Transformers + PEFT
245
 
246
- ---
 
 
247
 
248
  ## Environmental Impact
249
 
250
- * Uses parameter-efficient fine-tuning
251
- * Lower compute compared to full fine-tuning
252
- * Suitable for local deployment
253
 
254
- ---
255
 
256
- ## Intended Use
 
 
 
 
257
 
258
- ### Direct Use
259
 
260
- * Coding assistant
261
- * Debugging support
262
- * Learning programming
263
 
264
- ### Out-of-Scope Use
265
 
266
- * Security-critical systems
267
- * Autonomous production deployment
268
 
269
- ---
270
 
271
- ## Author
272
 
273
- **GIRISH KUMAR DEWANGAN**
274
 
275
- ---
276
 
277
- ## License
278
 
279
- Apache License 2.0
280
 
281
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model: Qwen/Qwen2.5-Coder-0.5B-Instruct
 
3
  library_name: peft
4
  pipeline_tag: text-generation
5
  tags:
6
+ - base_model:adapter:Qwen/Qwen2.5-Coder-0.5B-Instruct
7
+ - lora
8
+ - transformers
 
9
  ---
10
 
11
+ # Model Card for Model ID
12
+
13
+ <!-- Provide a quick summary of what the model is/does. -->
14
+
15
+
16
 
17
  ## Model Details
18
 
19
+ ### Model Description
 
 
 
 
 
 
20
 
21
+ <!-- Provide a longer summary of what this model is. -->
22
 
 
23
 
 
 
24
 
25
+ - **Developed by:** [More Information Needed]
26
+ - **Funded by [optional]:** [More Information Needed]
27
+ - **Shared by [optional]:** [More Information Needed]
28
+ - **Model type:** [More Information Needed]
29
+ - **Language(s) (NLP):** [More Information Needed]
30
+ - **License:** [More Information Needed]
31
+ - **Finetuned from model [optional]:** [More Information Needed]
32
 
33
+ ### Model Sources [optional]
 
 
34
 
35
+ <!-- Provide the basic links for the model. -->
36
 
37
+ - **Repository:** [More Information Needed]
38
+ - **Paper [optional]:** [More Information Needed]
39
+ - **Demo [optional]:** [More Information Needed]
40
 
41
+ ## Uses
42
 
43
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
 
 
44
 
45
+ ### Direct Use
46
 
47
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
48
 
49
+ [More Information Needed]
50
 
51
+ ### Downstream Use [optional]
52
 
53
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
 
 
 
 
 
54
 
55
+ [More Information Needed]
56
 
57
+ ### Out-of-Scope Use
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
60
 
61
+ [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
+ ## Bias, Risks, and Limitations
64
+
65
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
66
+
67
+ [More Information Needed]
68
+
69
+ ### Recommendations
70
+
71
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
72
+
73
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
74
+
75
+ ## How to Get Started with the Model
76
+
77
+ Use the code below to get started with the model.
78
+
79
+ [More Information Needed]
80
 
81
  ## Training Details
82
 
83
+ ### Training Data
84
+
85
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
86
 
87
+ [More Information Needed]
 
88
 
89
  ### Training Procedure
90
 
91
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
 
 
92
 
93
+ #### Preprocessing [optional]
94
 
95
+ [More Information Needed]
 
 
 
 
 
 
 
 
96
 
 
97
 
98
+ #### Training Hyperparameters
99
 
100
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
 
 
 
 
 
101
 
102
+ #### Speeds, Sizes, Times [optional]
103
+
104
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
105
+
106
+ [More Information Needed]
107
 
108
  ## Evaluation
109
 
110
+ <!-- This section describes the evaluation protocols and provides the results. -->
 
 
 
111
 
112
+ ### Testing Data, Factors & Metrics
113
 
114
+ #### Testing Data
115
 
116
+ <!-- This should link to a Dataset Card if possible. -->
 
 
 
117
 
118
+ [More Information Needed]
119
 
120
+ #### Factors
121
 
122
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
 
 
123
 
124
+ [More Information Needed]
125
 
126
+ #### Metrics
127
 
128
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
 
 
129
 
130
+ [More Information Needed]
131
 
132
+ ### Results
133
 
134
+ [More Information Needed]
 
 
 
 
135
 
136
+ #### Summary
 
 
137
 
 
138
 
 
139
 
140
+ ## Model Examination [optional]
 
 
141
 
142
+ <!-- Relevant interpretability work for the model goes here -->
143
+
144
+ [More Information Needed]
145
 
146
  ## Environmental Impact
147
 
148
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
 
 
149
 
150
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
151
 
152
+ - **Hardware Type:** [More Information Needed]
153
+ - **Hours used:** [More Information Needed]
154
+ - **Cloud Provider:** [More Information Needed]
155
+ - **Compute Region:** [More Information Needed]
156
+ - **Carbon Emitted:** [More Information Needed]
157
 
158
+ ## Technical Specifications [optional]
159
 
160
+ ### Model Architecture and Objective
 
 
161
 
162
+ [More Information Needed]
163
 
164
+ ### Compute Infrastructure
 
165
 
166
+ [More Information Needed]
167
 
168
+ #### Hardware
169
 
170
+ [More Information Needed]
171
 
172
+ #### Software
173
 
174
+ [More Information Needed]
175
 
176
+ ## Citation [optional]
177
 
178
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
179
+
180
+ **BibTeX:**
181
+
182
+ [More Information Needed]
183
+
184
+ **APA:**
185
+
186
+ [More Information Needed]
187
+
188
+ ## Glossary [optional]
189
+
190
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
191
+
192
+ [More Information Needed]
193
+
194
+ ## More Information [optional]
195
+
196
+ [More Information Needed]
197
+
198
+ ## Model Card Authors [optional]
199
+
200
+ [More Information Needed]
201
+
202
+ ## Model Card Contact
203
+
204
+ [More Information Needed]
205
+ ### Framework versions
206
+
207
+ - PEFT 0.19.0