Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
unsloth
trl
sft
4-bit precision
bitsandbytes
Instructions to use sca255/codeboxgptpython4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sca255/codeboxgptpython4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sca255/codeboxgptpython4bit")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sca255/codeboxgptpython4bit") model = AutoModelForCausalLM.from_pretrained("sca255/codeboxgptpython4bit") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sca255/codeboxgptpython4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sca255/codeboxgptpython4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sca255/codeboxgptpython4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sca255/codeboxgptpython4bit
- SGLang
How to use sca255/codeboxgptpython4bit 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 "sca255/codeboxgptpython4bit" \ --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": "sca255/codeboxgptpython4bit", "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 "sca255/codeboxgptpython4bit" \ --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": "sca255/codeboxgptpython4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use sca255/codeboxgptpython4bit 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 sca255/codeboxgptpython4bit 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 sca255/codeboxgptpython4bit to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sca255/codeboxgptpython4bit to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="sca255/codeboxgptpython4bit", max_seq_length=2048, ) - Docker Model Runner
How to use sca255/codeboxgptpython4bit with Docker Model Runner:
docker model run hf.co/sca255/codeboxgptpython4bit
Trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- config.json +19 -18
- generation_config.json +5 -4
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -1,24 +1,22 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "unsloth/
|
| 3 |
"architectures": [
|
| 4 |
-
"
|
| 5 |
],
|
| 6 |
-
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
-
"bos_token_id":
|
| 9 |
-
"eos_token_id":
|
| 10 |
"hidden_act": "silu",
|
| 11 |
"hidden_size": 2048,
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
-
"intermediate_size":
|
| 14 |
-
"max_position_embeddings":
|
| 15 |
-
"
|
| 16 |
-
"model_type": "
|
| 17 |
-
"num_attention_heads":
|
| 18 |
-
"num_hidden_layers":
|
| 19 |
-
"num_key_value_heads":
|
| 20 |
-
"pad_token_id":
|
| 21 |
-
"pretraining_tp": 1,
|
| 22 |
"quantization_config": {
|
| 23 |
"bnb_4bit_compute_dtype": "float16",
|
| 24 |
"bnb_4bit_quant_type": "nf4",
|
|
@@ -31,13 +29,16 @@
|
|
| 31 |
"load_in_8bit": false,
|
| 32 |
"quant_method": "bitsandbytes"
|
| 33 |
},
|
| 34 |
-
"rms_norm_eps": 1e-
|
| 35 |
"rope_scaling": null,
|
| 36 |
-
"rope_theta":
|
| 37 |
-
"
|
|
|
|
| 38 |
"torch_dtype": "float16",
|
| 39 |
"transformers_version": "4.44.2",
|
| 40 |
"unsloth_version": "2024.9.post4",
|
| 41 |
"use_cache": true,
|
| 42 |
-
"
|
|
|
|
|
|
|
| 43 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "unsloth/qwen2.5-3b-bnb-4bit",
|
| 3 |
"architectures": [
|
| 4 |
+
"Qwen2ForCausalLM"
|
| 5 |
],
|
|
|
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 151643,
|
| 8 |
+
"eos_token_id": 151643,
|
| 9 |
"hidden_act": "silu",
|
| 10 |
"hidden_size": 2048,
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 11008,
|
| 13 |
+
"max_position_embeddings": 32768,
|
| 14 |
+
"max_window_layers": 36,
|
| 15 |
+
"model_type": "qwen2",
|
| 16 |
+
"num_attention_heads": 16,
|
| 17 |
+
"num_hidden_layers": 36,
|
| 18 |
+
"num_key_value_heads": 2,
|
| 19 |
+
"pad_token_id": 151665,
|
|
|
|
| 20 |
"quantization_config": {
|
| 21 |
"bnb_4bit_compute_dtype": "float16",
|
| 22 |
"bnb_4bit_quant_type": "nf4",
|
|
|
|
| 29 |
"load_in_8bit": false,
|
| 30 |
"quant_method": "bitsandbytes"
|
| 31 |
},
|
| 32 |
+
"rms_norm_eps": 1e-06,
|
| 33 |
"rope_scaling": null,
|
| 34 |
+
"rope_theta": 1000000.0,
|
| 35 |
+
"sliding_window": null,
|
| 36 |
+
"tie_word_embeddings": true,
|
| 37 |
"torch_dtype": "float16",
|
| 38 |
"transformers_version": "4.44.2",
|
| 39 |
"unsloth_version": "2024.9.post4",
|
| 40 |
"use_cache": true,
|
| 41 |
+
"use_mrope": false,
|
| 42 |
+
"use_sliding_window": false,
|
| 43 |
+
"vocab_size": 151936
|
| 44 |
}
|
generation_config.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
{
|
| 2 |
-
"bos_token_id":
|
| 3 |
-
"eos_token_id":
|
| 4 |
-
"max_length":
|
| 5 |
-
"
|
|
|
|
| 6 |
"transformers_version": "4.44.2"
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token_id": 151643,
|
| 3 |
+
"eos_token_id": 151643,
|
| 4 |
+
"max_length": 32768,
|
| 5 |
+
"max_new_tokens": 2048,
|
| 6 |
+
"pad_token_id": 151665,
|
| 7 |
"transformers_version": "4.44.2"
|
| 8 |
}
|
model.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:6849d8056dca58438a3c2cb39d0b475634485b8e4f02586a8f079df068ff6a44
|
| 3 |
+
size 2676955807
|