Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,258 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
-
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
## Model Details
|
| 13 |
|
| 14 |
### Model Description
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 19 |
|
| 20 |
-
- **Developed by:** [
|
| 21 |
-
- **
|
| 22 |
-
- **
|
| 23 |
-
- **
|
| 24 |
-
- **
|
| 25 |
-
- **
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
### Model Sources
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
- **Repository:** [More Information Needed]
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
## Uses
|
| 37 |
|
| 38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
-
|
| 40 |
### Direct Use
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
###
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
| 51 |
|
| 52 |
### Out-of-Scope Use
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
## Bias, Risks, and Limitations
|
| 59 |
-
|
| 60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 61 |
-
|
| 62 |
-
[More Information Needed]
|
| 63 |
-
|
| 64 |
-
### Recommendations
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 67 |
-
|
| 68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 69 |
|
| 70 |
## How to Get Started with the Model
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
| 78 |
### Training Data
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
#### Preprocessing [optional]
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
|
|
|
|
| 92 |
|
| 93 |
#### Training Hyperparameters
|
| 94 |
|
| 95 |
-
- **Training
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 100 |
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
-
|
| 106 |
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
-
|
| 110 |
|
| 111 |
-
|
| 112 |
|
| 113 |
-
|
|
|
|
| 114 |
|
| 115 |
-
|
|
|
|
| 116 |
|
| 117 |
-
|
|
|
|
| 118 |
|
| 119 |
-
|
| 120 |
|
| 121 |
-
|
| 122 |
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
## Environmental Impact
|
| 142 |
-
|
| 143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
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).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
|
| 159 |
### Compute Infrastructure
|
| 160 |
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
#### Hardware
|
| 164 |
-
|
| 165 |
-
|
|
|
|
| 166 |
|
| 167 |
#### Software
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
-
**
|
|
|
|
|
|
|
|
|
|
| 176 |
|
| 177 |
-
|
| 178 |
|
| 179 |
-
**
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
-
|
| 182 |
|
| 183 |
-
|
| 184 |
|
| 185 |
-
|
|
|
|
|
|
|
|
|
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
-
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
-
## Model Card Authors
|
| 194 |
|
| 195 |
-
[
|
| 196 |
|
| 197 |
## Model Card Contact
|
| 198 |
|
| 199 |
-
[
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
tags:
|
| 4 |
+
- devops
|
| 5 |
+
- linux
|
| 6 |
+
- system-administration
|
| 7 |
+
- technical-support
|
| 8 |
+
- question-answering
|
| 9 |
+
- mistral
|
| 10 |
+
- peft
|
| 11 |
+
language:
|
| 12 |
+
- en
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
license: apache-2.0
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# mini-DevOpsGPT-7B
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
A specialized DevOps assistant for answering DevOps-related, Linux system administration, Docker, and questions.
|
| 20 |
|
| 21 |
## Model Details
|
| 22 |
|
| 23 |
### Model Description
|
| 24 |
|
| 25 |
+
This model is specifically trained to assist with DevOps tasks, Linux system administration, and technical troubleshooting. It provides accurate, practical answers for common infrastructure and system management questions.
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
- **Developed by:** [Prashant Lakhera]
|
| 28 |
+
- **Model type:** Causal Language Model (Auto-regressive)
|
| 29 |
+
- **Language(s):** English
|
| 30 |
+
- **License:** Apache 2.0
|
| 31 |
+
- **Training method:** LoRA (Low-Rank Adaptation) with 4-bit quantization
|
| 32 |
+
- **Specialization:** DevOps, Linux Administration, System Troubleshooting
|
|
|
|
| 33 |
|
| 34 |
+
### Model Sources
|
| 35 |
|
| 36 |
+
- **Fine-tuning:** Custom DevOps dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
## Uses
|
| 39 |
|
|
|
|
|
|
|
| 40 |
### Direct Use
|
| 41 |
|
| 42 |
+
This model is designed for:
|
| 43 |
+
- **DevOps Q&A**: Answering questions about system administration, deployment, and infrastructure
|
| 44 |
+
- **Linux Help**: Providing command-line solutions and troubleshooting steps
|
| 45 |
+
- **Docker/Container Support**: Assistance with containerization and orchestration
|
| 46 |
+
- **System Monitoring**: Guidance on logging, monitoring, and debugging
|
| 47 |
+
- **Automation Advice**: Help with scripting and workflow automation
|
| 48 |
|
| 49 |
+
### Example Use Cases
|
| 50 |
|
| 51 |
+
- DevOps automation for IT support
|
| 52 |
+
- Developer productivity tools
|
| 53 |
+
- System administration training
|
| 54 |
+
- Technical documentation assistance
|
| 55 |
+
- Infrastructure troubleshooting
|
| 56 |
|
| 57 |
### Out-of-Scope Use
|
| 58 |
|
| 59 |
+
- **Not suitable for**: Medical advice, legal guidance, financial decisions
|
| 60 |
+
- **Limitations**: May not have knowledge of very recent tools or updates
|
| 61 |
+
- **Security**: Should not be used for security-critical decisions without validation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
## How to Get Started with the Model
|
| 64 |
|
| 65 |
+
### Installation
|
| 66 |
+
|
| 67 |
+
```bash
|
| 68 |
+
pip install transformers torch accelerate peft bitsandbytes
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
### Basic Usage
|
| 72 |
+
|
| 73 |
+
```python
|
| 74 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 75 |
+
import torch
|
| 76 |
+
|
| 77 |
+
# Load model and tokenizer
|
| 78 |
+
model_name = "your-username/mini-DevOpsGPT-7B"
|
| 79 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 80 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 81 |
+
model_name,
|
| 82 |
+
torch_dtype=torch.float16,
|
| 83 |
+
device_map="auto"
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
# Example usage
|
| 87 |
+
question = "How to check disk space in Linux?"
|
| 88 |
+
inputs = tokenizer(question, return_tensors="pt")
|
| 89 |
+
|
| 90 |
+
with torch.no_grad():
|
| 91 |
+
outputs = model.generate(
|
| 92 |
+
**inputs,
|
| 93 |
+
max_length=inputs.input_ids.shape[1] + 100,
|
| 94 |
+
temperature=0.7,
|
| 95 |
+
do_sample=True,
|
| 96 |
+
pad_token_id=tokenizer.eos_token_id
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 100 |
+
print(response)
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
### Chat Interface Example
|
| 104 |
+
|
| 105 |
+
```python
|
| 106 |
+
def ask_devops_question(question):
|
| 107 |
+
inputs = tokenizer(f"Question: {question}\n\nAnswer:", return_tensors="pt")
|
| 108 |
+
|
| 109 |
+
with torch.no_grad():
|
| 110 |
+
outputs = model.generate(
|
| 111 |
+
**inputs,
|
| 112 |
+
max_length=200,
|
| 113 |
+
temperature=0.7,
|
| 114 |
+
do_sample=True,
|
| 115 |
+
pad_token_id=tokenizer.eos_token_id,
|
| 116 |
+
eos_token_id=tokenizer.eos_token_id
|
| 117 |
+
)
|
| 118 |
+
|
| 119 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 120 |
+
return response.split("Answer:")[-1].strip()
|
| 121 |
+
|
| 122 |
+
# Example questions
|
| 123 |
+
print(ask_devops_question("How to restart Docker service?"))
|
| 124 |
+
print(ask_devops_question("How to kill a process by PID?"))
|
| 125 |
+
print(ask_devops_question("How to view log files in real time?"))
|
| 126 |
+
```
|
| 127 |
|
| 128 |
## Training Details
|
| 129 |
|
| 130 |
### Training Data
|
| 131 |
|
| 132 |
+
The model was fine-tuned on a curated dataset of DevOps question-answer pairs covering:
|
| 133 |
+
- Linux system administration commands
|
| 134 |
+
- Docker and containerization
|
| 135 |
+
- Process management
|
| 136 |
+
- File system operations
|
| 137 |
+
- Network troubleshooting
|
| 138 |
+
- Log analysis and monitoring
|
| 139 |
+
- Kubernetes
|
| 140 |
|
| 141 |
+
**Dataset Format:**
|
| 142 |
+
```
|
| 143 |
+
How to check disk space in Linux?
|
| 144 |
|
| 145 |
+
Use df -h command to check disk space usage.
|
| 146 |
+
```
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
+
### Training Procedure
|
| 149 |
|
| 150 |
#### Training Hyperparameters
|
| 151 |
|
| 152 |
+
- **Training method:** LoRA (Low-Rank Adaptation)
|
| 153 |
+
- **Quantization:** 4-bit (int4) using bitsandbytes
|
| 154 |
+
- **Training regime:** fp16 mixed precision
|
|
|
|
|
|
|
| 155 |
|
| 156 |
+
**LoRA Configuration:**
|
| 157 |
+
- **LoRA Rank (r):** 16
|
| 158 |
+
- **LoRA Alpha:** 32
|
| 159 |
+
- **LoRA Dropout:** 0.05
|
| 160 |
+
- **Target Modules:** q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
| 161 |
|
| 162 |
+
**Training Parameters:**
|
| 163 |
+
- **Epochs:** 3
|
| 164 |
+
- **Batch Size:** 2 (per device)
|
| 165 |
+
- **Gradient Accumulation Steps:** 4
|
| 166 |
+
- **Learning Rate:** 3e-5
|
| 167 |
+
- **Optimizer:** AdamW
|
| 168 |
+
- **Scheduler:** Linear with warmup
|
| 169 |
+
- **Warmup Ratio:** 0.1
|
| 170 |
+
- **Max Sequence Length:** 1024
|
| 171 |
+
- **Max Gradient Norm:** 1.0
|
| 172 |
|
| 173 |
+
#### Speeds, Sizes, Times
|
| 174 |
|
| 175 |
+
- **Training Time:** ~45-60 minutes on Nvidia A10 large GPU
|
| 176 |
+
- **Model Size:** ~7B parameters (base) + ~16M trainable LoRA parameters
|
| 177 |
+
- **Memory Usage:** ~10GB GPU RAM during training
|
| 178 |
+
- **Final Model Size:** ~2GB (with quantization and LoRA)
|
| 179 |
|
| 180 |
+
## Performance
|
| 181 |
|
| 182 |
+
### Example Outputs
|
| 183 |
|
| 184 |
+
**Input:** "How to check running processes in Linux?"
|
| 185 |
+
**Output:** "Use ps aux command to list all running processes with detailed information including CPU and memory usage."
|
| 186 |
|
| 187 |
+
**Input:** "How to restart Docker service?"
|
| 188 |
+
**Output:** "Run sudo systemctl restart docker to restart the Docker service on systemd-based systems."
|
| 189 |
|
| 190 |
+
**Input:** "How to kill a process by PID?"
|
| 191 |
+
**Output:** "Use kill -9 PID to forcefully terminate a process, replacing PID with the actual process ID."
|
| 192 |
|
| 193 |
+
## Technical Specifications
|
| 194 |
|
| 195 |
+
### Model Architecture
|
| 196 |
|
| 197 |
+
- **Parameters:** 7.24B total, ~16M trainable (LoRA)
|
| 198 |
+
- **Attention:** Grouped Query Attention
|
| 199 |
+
- **Vocabulary Size:** 32,000
|
| 200 |
+
- **Context Length:** 8,192 tokens (base), 1,024 used in training
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
### Compute Infrastructure
|
| 203 |
|
|
|
|
|
|
|
| 204 |
#### Hardware
|
| 205 |
+
- **Training:** Nvidia A10 large GPU
|
| 206 |
+
- **Memory:** ~10GB GPU RAM required
|
| 207 |
+
- **Inference:** Compatible with consumer GPUs (8GB+ recommended)
|
| 208 |
|
| 209 |
#### Software
|
| 210 |
+
- **Framework:** PyTorch + Transformers
|
| 211 |
+
- **Libraries:** PEFT, bitsandbytes, accelerate
|
| 212 |
+
- **Quantization:** 4-bit using bitsandbytes
|
| 213 |
|
| 214 |
+
## Limitations and Bias
|
|
|
|
|
|
|
| 215 |
|
| 216 |
+
### Known Limitations
|
| 217 |
|
| 218 |
+
- **Domain Scope:** Primarily trained on Linux/Unix-based systems
|
| 219 |
+
- **Recency:** Knowledge cutoff from base model training
|
| 220 |
+
- **Commands:** May need verification for specific system configurations
|
| 221 |
+
- **Security:** Always validate security-related commands before execution
|
| 222 |
|
| 223 |
+
### Recommendations
|
| 224 |
|
| 225 |
+
- **Verify Commands:** Test commands in safe environments first
|
| 226 |
+
- **System Specific:** Adapt commands to your specific Linux distribution
|
| 227 |
+
- **Security:** Review security implications of suggested commands
|
| 228 |
+
- **Updates:** Check for newer versions of tools and commands
|
| 229 |
|
| 230 |
+
## Environmental Impact
|
| 231 |
|
| 232 |
+
Training was conducted on Nvidia A10 large GPU infrastructure:
|
| 233 |
|
| 234 |
+
- **Hardware Type:** Nvidia A10 large GPUNVIDIA T4 GPU
|
| 235 |
+
- **Hours used:** ~1 hour
|
| 236 |
+
- **Compute Region:** Variable (Colab auto-assignment)
|
| 237 |
+
- **Carbon Emitted:** Minimal due to short training time and shared infrastructure
|
| 238 |
|
| 239 |
+
## Citation
|
| 240 |
|
| 241 |
+
If you use this model, please cite:
|
| 242 |
|
| 243 |
+
```bibtex
|
| 244 |
+
@misc{mini-devopsgpt-7b,
|
| 245 |
+
title={mini-DevOpsGPT-7B: A Model for DevOps Tasks},
|
| 246 |
+
author={[lakhera2023]},
|
| 247 |
+
year={2025},
|
| 248 |
+
howpublished={\\url{https://huggingface.co/lakhera2023/mini-DevOpsGPT-7B}},
|
| 249 |
+
}
|
| 250 |
+
```
|
| 251 |
|
| 252 |
+
## Model Card Authors
|
| 253 |
|
| 254 |
+
[lakhera2023/mini-DevOpsGPT-7b]
|
| 255 |
|
| 256 |
## Model Card Contact
|
| 257 |
|
| 258 |
+
[laprashant@gmail.com]
|