Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
unsloth
trl
sft
4-bit precision
bitsandbytes
Instructions to use dbands/llama-3-8b-sql-instruct_4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dbands/llama-3-8b-sql-instruct_4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dbands/llama-3-8b-sql-instruct_4bit")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dbands/llama-3-8b-sql-instruct_4bit") model = AutoModelForCausalLM.from_pretrained("dbands/llama-3-8b-sql-instruct_4bit") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use dbands/llama-3-8b-sql-instruct_4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dbands/llama-3-8b-sql-instruct_4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dbands/llama-3-8b-sql-instruct_4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dbands/llama-3-8b-sql-instruct_4bit
- SGLang
How to use dbands/llama-3-8b-sql-instruct_4bit 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 "dbands/llama-3-8b-sql-instruct_4bit" \ --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": "dbands/llama-3-8b-sql-instruct_4bit", "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 "dbands/llama-3-8b-sql-instruct_4bit" \ --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": "dbands/llama-3-8b-sql-instruct_4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio new
How to use dbands/llama-3-8b-sql-instruct_4bit with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dbands/llama-3-8b-sql-instruct_4bit to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dbands/llama-3-8b-sql-instruct_4bit to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for dbands/llama-3-8b-sql-instruct_4bit to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="dbands/llama-3-8b-sql-instruct_4bit", max_seq_length=2048, ) - Docker Model Runner
How to use dbands/llama-3-8b-sql-instruct_4bit with Docker Model Runner:
docker model run hf.co/dbands/llama-3-8b-sql-instruct_4bit
Trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- config.json +2 -2
- model-00001-of-00002.safetensors +2 -2
- model-00002-of-00002.safetensors +1 -1
- model.safetensors.index.json +1 -1
config.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
"num_key_value_heads": 8,
|
| 19 |
"pretraining_tp": 1,
|
| 20 |
"quantization_config": {
|
| 21 |
-
"bnb_4bit_compute_dtype": "
|
| 22 |
"bnb_4bit_quant_type": "nf4",
|
| 23 |
"bnb_4bit_use_double_quant": true,
|
| 24 |
"llm_int8_enable_fp32_cpu_offload": false,
|
|
@@ -33,7 +33,7 @@
|
|
| 33 |
"rope_scaling": null,
|
| 34 |
"rope_theta": 500000.0,
|
| 35 |
"tie_word_embeddings": false,
|
| 36 |
-
"torch_dtype": "
|
| 37 |
"transformers_version": "4.40.0",
|
| 38 |
"unsloth_version": "2024.4",
|
| 39 |
"use_cache": true,
|
|
|
|
| 18 |
"num_key_value_heads": 8,
|
| 19 |
"pretraining_tp": 1,
|
| 20 |
"quantization_config": {
|
| 21 |
+
"bnb_4bit_compute_dtype": "bfloat16",
|
| 22 |
"bnb_4bit_quant_type": "nf4",
|
| 23 |
"bnb_4bit_use_double_quant": true,
|
| 24 |
"llm_int8_enable_fp32_cpu_offload": false,
|
|
|
|
| 33 |
"rope_scaling": null,
|
| 34 |
"rope_theta": 500000.0,
|
| 35 |
"tie_word_embeddings": false,
|
| 36 |
+
"torch_dtype": "bfloat16",
|
| 37 |
"transformers_version": "4.40.0",
|
| 38 |
"unsloth_version": "2024.4",
|
| 39 |
"use_cache": true,
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed8dafd1e3ecabbec909d807581eb3030a61086f0efaf2d30295a9f0f5540283
|
| 3 |
+
size 4652072923
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1050673280
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c5394fe848f6eafef2a44f085e7b72e5ef0d315f98aa87b3827c2b1e6983b89
|
| 3 |
size 1050673280
|
model.safetensors.index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
-
"total_size":
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"lm_head.weight": "model-00002-of-00002.safetensors",
|
|
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
+
"total_size": 5702577739
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"lm_head.weight": "model-00002-of-00002.safetensors",
|