Instructions to use lebe1/opt-125m-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lebe1/opt-125m-8bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lebe1/opt-125m-8bit")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lebe1/opt-125m-8bit") model = AutoModelForCausalLM.from_pretrained("lebe1/opt-125m-8bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lebe1/opt-125m-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lebe1/opt-125m-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lebe1/opt-125m-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/lebe1/opt-125m-8bit
- SGLang
How to use lebe1/opt-125m-8bit 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 "lebe1/opt-125m-8bit" \ --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": "lebe1/opt-125m-8bit", "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 "lebe1/opt-125m-8bit" \ --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": "lebe1/opt-125m-8bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use lebe1/opt-125m-8bit with Docker Model Runner:
docker model run hf.co/lebe1/opt-125m-8bit
AutoGPTQ model for facebook/opt-125m: 8bits
Browse files- config.json +28 -1
- generation_config.json +7 -0
- model.safetensors +3 -0
config.json
CHANGED
|
@@ -23,8 +23,35 @@
|
|
| 23 |
"num_hidden_layers": 12,
|
| 24 |
"pad_token_id": 1,
|
| 25 |
"prefix": "</s>",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
"torch_dtype": "float16",
|
| 27 |
-
"transformers_version": "4.
|
| 28 |
"use_cache": true,
|
| 29 |
"vocab_size": 50272,
|
| 30 |
"word_embed_proj_dim": 768
|
|
|
|
| 23 |
"num_hidden_layers": 12,
|
| 24 |
"pad_token_id": 1,
|
| 25 |
"prefix": "</s>",
|
| 26 |
+
"quantization_config": {
|
| 27 |
+
"batch_size": 1,
|
| 28 |
+
"bits": 8,
|
| 29 |
+
"block_name_to_quantize": "model.decoder.layers",
|
| 30 |
+
"cache_block_outputs": true,
|
| 31 |
+
"damp_percent": 0.1,
|
| 32 |
+
"dataset": "c4",
|
| 33 |
+
"desc_act": false,
|
| 34 |
+
"disable_exllama": false,
|
| 35 |
+
"exllama_config": {
|
| 36 |
+
"version": 2
|
| 37 |
+
},
|
| 38 |
+
"exllama_version": 2,
|
| 39 |
+
"group_size": 128,
|
| 40 |
+
"max_input_length": null,
|
| 41 |
+
"model_seqlen": 2048,
|
| 42 |
+
"module_name_preceding_first_block": [
|
| 43 |
+
"model.decoder.embed_tokens",
|
| 44 |
+
"model.decoder.embed_positions",
|
| 45 |
+
"model.decoder.final_layer_norm"
|
| 46 |
+
],
|
| 47 |
+
"pad_token_id": null,
|
| 48 |
+
"quant_method": "gptq",
|
| 49 |
+
"sym": true,
|
| 50 |
+
"true_sequential": true,
|
| 51 |
+
"use_cuda_fp16": true
|
| 52 |
+
},
|
| 53 |
"torch_dtype": "float16",
|
| 54 |
+
"transformers_version": "4.35.2",
|
| 55 |
"use_cache": true,
|
| 56 |
"vocab_size": 50272,
|
| 57 |
"word_embed_proj_dim": 768
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"pad_token_id": 1,
|
| 6 |
+
"transformers_version": "4.35.2"
|
| 7 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f8221e38ef63a6482c86fb0ba859e36724db2b9ea2d0481e26dff838de51985d
|
| 3 |
+
size 167912856
|