Instructions to use AchrafTasfaout/Mistral-7B-SQL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use AchrafTasfaout/Mistral-7B-SQL with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("TheBloke/Mistral-7B-Instruct-v0.2-GPTQ") model = PeftModel.from_pretrained(base_model, "AchrafTasfaout/Mistral-7B-SQL") - Notebooks
- Google Colab
- Kaggle
| base_model: mistralai/Mistral-7B-Instruct-v0.2 | |
| library_name: peft | |
| license: apache-2.0 | |
| tags: | |
| - generated_from_trainer | |
| - LoRa | |
| model-index: | |
| - name: mistral-7b-sql | |
| results: [] | |
| # mistral-7b-sql | |
| This model is a fine-tuned version of [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) on the Hyper dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 1.0316 | |
| ## Intended uses & limitations | |
| This model is intended to be used for Text-to-SQL tasks, such as an interface for querying a database in natural language. | |
| ## Training procedure | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 0.0002 | |
| - train_batch_size: 4 | |
| - eval_batch_size: 4 | |
| - seed: 42 | |
| - gradient_accumulation_steps: 4 | |
| - total_train_batch_size: 16 | |
| - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 | |
| - lr_scheduler_type: linear | |
| - lr_scheduler_warmup_steps: 2 | |
| - num_epochs: 10 | |
| - mixed_precision_training: Native AMP | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | | |
| |:-------------:|:------:|:----:|:---------------:| | |
| | 2.3669 | 0.9231 | 3 | 2.0030 | | |
| | 1.9273 | 1.8462 | 6 | 1.6669 | | |
| | 1.5048 | 2.7692 | 9 | 1.4241 | | |
| | 0.915 | 4.0 | 13 | 1.2316 | | |
| | 0.9884 | 4.9231 | 16 | 1.1354 | | |
| | 0.8136 | 5.8462 | 19 | 1.0745 | | |
| | 0.684 | 6.7692 | 22 | 1.0422 | | |
| | 0.4341 | 8.0 | 26 | 1.0330 | | |
| | 0.526 | 8.9231 | 29 | 1.0319 | | |
| | 0.3763 | 9.2308 | 30 | 1.0316 | | |
| ### Framework versions | |
| - PEFT 0.11.1 | |
| - Transformers 4.41.2 | |
| - Pytorch 2.1.0+cu121 | |
| - Datasets 2.20.0 | |
| - Tokenizers 0.19.1 |