Instructions to use onuralp/Llama-2-7b-QLoRA-03 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use onuralp/Llama-2-7b-QLoRA-03 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="onuralp/Llama-2-7b-QLoRA-03")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("onuralp/Llama-2-7b-QLoRA-03") model = AutoModelForCausalLM.from_pretrained("onuralp/Llama-2-7b-QLoRA-03", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use onuralp/Llama-2-7b-QLoRA-03 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "onuralp/Llama-2-7b-QLoRA-03" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "onuralp/Llama-2-7b-QLoRA-03", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/onuralp/Llama-2-7b-QLoRA-03
- SGLang
How to use onuralp/Llama-2-7b-QLoRA-03 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 "onuralp/Llama-2-7b-QLoRA-03" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "onuralp/Llama-2-7b-QLoRA-03", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "onuralp/Llama-2-7b-QLoRA-03" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "onuralp/Llama-2-7b-QLoRA-03", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use onuralp/Llama-2-7b-QLoRA-03 with Docker Model Runner:
docker model run hf.co/onuralp/Llama-2-7b-QLoRA-03
| base_model: meta-llama/Llama-2-7b-hf | |
| tags: | |
| - generated_from_trainer | |
| model-index: | |
| - name: qlora-out | |
| results: [] | |
| <!-- This model card has been generated automatically according to the information the Trainer had access to. You | |
| should probably proofread and complete it, then remove this comment. --> | |
| [<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl) | |
| # qlora-out | |
| This model is a fine-tuned version of [meta-llama/Llama-2-7b-hf](https://huggingface.co/meta-llama/Llama-2-7b-hf) on the None dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 0.5703 | |
| ## Model description | |
| More information needed | |
| ## Intended uses & limitations | |
| More information needed | |
| ## Training and evaluation data | |
| More information needed | |
| ## Training procedure | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 0.0004 | |
| - train_batch_size: 1 | |
| - eval_batch_size: 1 | |
| - seed: 42 | |
| - gradient_accumulation_steps: 16 | |
| - total_train_batch_size: 16 | |
| - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 | |
| - lr_scheduler_type: cosine | |
| - lr_scheduler_warmup_steps: 100 | |
| - num_epochs: 2 | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | | |
| |:-------------:|:-----:|:----:|:---------------:| | |
| | 0.8756 | 0.06 | 20 | 0.7111 | | |
| | 0.9058 | 0.11 | 40 | 0.6764 | | |
| | 0.7526 | 0.17 | 60 | 0.6669 | | |
| | 0.6926 | 0.23 | 80 | 0.6363 | | |
| | 0.6731 | 0.28 | 100 | 0.6187 | | |
| | 0.647 | 0.34 | 120 | 0.6162 | | |
| | 0.6219 | 0.4 | 140 | 0.6041 | | |
| | 0.5781 | 0.45 | 160 | 0.5937 | | |
| | 0.6346 | 0.51 | 180 | 0.6006 | | |
| | 0.7663 | 0.57 | 200 | 0.5926 | | |
| | 0.5864 | 0.62 | 220 | 0.5866 | | |
| | 0.5943 | 0.68 | 240 | 0.5756 | | |
| | 0.5029 | 0.74 | 260 | 0.5733 | | |
| | 0.5482 | 0.79 | 280 | 0.5712 | | |
| | 0.5413 | 0.85 | 300 | 0.5820 | | |
| | 0.657 | 0.91 | 320 | 0.5696 | | |
| | 0.506 | 0.96 | 340 | 0.5839 | | |
| | 0.4804 | 1.02 | 360 | 0.5803 | | |
| | 0.5095 | 1.08 | 380 | 0.5974 | | |
| | 0.4404 | 1.13 | 400 | 0.5746 | | |
| | 0.3869 | 1.19 | 420 | 0.5740 | | |
| | 0.4129 | 1.25 | 440 | 0.5777 | | |
| | 0.4209 | 1.3 | 460 | 0.5825 | | |
| | 0.4014 | 1.36 | 480 | 0.5742 | | |
| | 0.3333 | 1.42 | 500 | 0.5851 | | |
| | 0.5041 | 1.47 | 520 | 0.5798 | | |
| | 0.5528 | 1.53 | 540 | 0.5631 | | |
| | 0.4372 | 1.59 | 560 | 0.5747 | | |
| | 0.3901 | 1.64 | 580 | 0.5625 | | |
| | 0.5271 | 1.7 | 600 | 0.5746 | | |
| | 0.4283 | 1.76 | 620 | 0.5662 | | |
| | 0.4336 | 1.81 | 640 | 0.5652 | | |
| | 0.3534 | 1.87 | 660 | 0.5697 | | |
| | 0.4728 | 1.93 | 680 | 0.5713 | | |
| | 0.5159 | 1.98 | 700 | 0.5703 | | |
| ### Framework versions | |
| - Transformers 4.34.1 | |
| - Pytorch 2.0.1+cu118 | |
| - Datasets 2.14.6 | |
| - Tokenizers 0.14.1 | |