File size: 5,235 Bytes
6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 6422bf7 b70d627 |
1 2 3 4 5 6 7 8 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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 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 |
---
library_name: transformers
tags:
- mistral-8b
- openassistant
- openassisted-english
- language-modeling
- text-generation
- conversational-ai
license: apache-2.0
language:
- en
base_model:
- mistralai/Mistral-7B-Instruct-v0.1
---
# Mistral-8B Instruction-Tuned on OpenAssisted-English
This model is a fine-tuned version of [Mistral-8B](https://huggingface.co/mistralai/Mistral-7B-v0.1) on the [OpenAssisted-English](https://huggingface.co/datasets/OpenAssistant/oasst1) dataset using Hugging Face's `transformers` library. The model is optimized for high-quality conversational and instruction-following tasks in English.
---
## Model Details
### Model Description
This model is an instruction-tuned version of the Mistral-8B architecture, fine-tuned specifically to follow human instructions and engage in helpful, safe, and factual conversations. It leverages the OpenAssisted-English dataset, a cleaned and filtered subset from OpenAssistant's OASST1 dataset.
* **Developed by:** Akshay Kumar BM
* **Fine-tuned using:** Hugging Face Transformers
* **Dataset used:** OpenAssisted-English (from OpenAssistant)
* **Model type:** Decoder-only Transformer
* **Language(s):** English
* **License:** Apache 2.0
* **Finetuned from model:** mistralai/Mistral-7B-v0.1
---
## Model Sources
* **Base Model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
* **Dataset:** [OpenAssisted-English](https://huggingface.co/datasets/OpenAssistant/oasst1)
* **Library:** Hugging Face Transformers
* **Frameworks:** PyTorch, Accelerate
---
## Uses
### Direct Use
* Conversational AI
* Instruction-following agents
* Text completion and generation
* Chatbot backends
* Question answering
### Downstream Use
* Fine-tuning for specific domains (e.g., legal, medical, education)
* Integration into multi-agent systems or RAG pipelines
* Prompt engineering and prototyping
### Out-of-Scope Use
* Use in high-risk environments (e.g., medical diagnosis, legal decision making) without human oversight.
* Generating misinformation, harmful, offensive, or biased content.
* Any use violating Hugging Face’s or Apache 2.0 licensing terms.
---
## Bias, Risks, and Limitations
Despite being fine-tuned for alignment, the model may:
* Hallucinate facts.
* Reflect biases present in the OpenAssistant dataset.
* Respond unpredictably to adversarial or ambiguous prompts.
### Recommendations
* Always include a human-in-the-loop for sensitive applications.
* Evaluate in domain-specific scenarios before deployment.
* Apply additional safety filters for production use.
---
## How to Get Started
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Akshaykumarbm/OpenAssisted-English-Mistral-7b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
input_prompt = "Explain quantum computing in simple terms."
inputs = tokenizer(input_prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
---
## Training Details
### Training Data
The model was trained on the **OpenAssisted-English** dataset, which includes high-quality, human-annotated instruction-response pairs derived from OpenAssistant’s OASST1 dataset.
* Format: Instruction + Response
* Filters: Language = English, Quality ≥ 3, Assistant messages only
* Size: \~100k samples
### Training Procedure
#### Preprocessing
* Tokenization: BPE tokenizer from Mistral
* Truncation: 4096 tokens
* Format: `<s>[INST] prompt [/INST] response</s>`
#### Hyperparameters
* **Precision:** bf16 mixed precision
* **Batch size:** 512 (global)
* **Epochs:** 15
* **Optimizer:** AdamW
* **LR Scheduler:** CosineDecay
* **Learning rate:** 2e-5
* **Warmup steps:** 500
#### Compute
* **Hardware:** AMD MI300
* **Training time:** \~18 hours
* **Frameworks:** PyTorch + Accelerate + DDP
---
## Evaluation
### Testing Data
* Held-out subset from OpenAssisted-English
* Manual eval for coherence, helpfulness, and safety
* Evaluation on MT-Bench and AlpacaEval (optional)
### Metrics
* **Helpfulness Score** (manual): \~7.2/10
* **Toxicity (Perspective API):** <1%
* **BLEU, ROUGE:** Used to compare with gold responses
---
## Technical Specifications
* **Architecture:** Mistral 8B (decoder-only transformer)
* **Tokenizer:** Mistral Tokenizer (32k vocab)
* **Context Length:** 8k tokens
* **Parameters:** \~8.1 billion
---
## Citation
If you use this model, please cite the original Mistral model and OpenAssistant dataset.
```bibtex
@misc{mistral2023,
title={Mistral 7B},
author={Mistral AI},
year={2023},
url={https://mistral.ai/news/announcing-mistral-7b/}
}
@misc{openassistant2023,
title = {OpenAssistant Conversations - OASST1},
author = {OpenAssistant Contributors},
year = {2023},
url = {https://huggingface.co/datasets/OpenAssistant/oasst1}
}
```
---
## Contact
* **Author:** Akshay Kumar BM
* **Email:** [akshaykumarbedre.bm@gmail.com](mailto:akshaykumarbedre.bm@gmail.com)
* **GitHub:** [akshaykumarbedre](https://github.com/akshaykumarbedre)
* **Hugging Face:** [akshaykumarbm](https://huggingface.co/akshaykumarbm)
--- |