Instructions to use Plaban81/codegen-int4-GPTQ-python-code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Plaban81/codegen-int4-GPTQ-python-code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Plaban81/codegen-int4-GPTQ-python-code")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Plaban81/codegen-int4-GPTQ-python-code") model = AutoModelForCausalLM.from_pretrained("Plaban81/codegen-int4-GPTQ-python-code") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Plaban81/codegen-int4-GPTQ-python-code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Plaban81/codegen-int4-GPTQ-python-code" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Plaban81/codegen-int4-GPTQ-python-code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Plaban81/codegen-int4-GPTQ-python-code
- SGLang
How to use Plaban81/codegen-int4-GPTQ-python-code 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 "Plaban81/codegen-int4-GPTQ-python-code" \ --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": "Plaban81/codegen-int4-GPTQ-python-code", "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 "Plaban81/codegen-int4-GPTQ-python-code" \ --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": "Plaban81/codegen-int4-GPTQ-python-code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Plaban81/codegen-int4-GPTQ-python-code with Docker Model Runner:
docker model run hf.co/Plaban81/codegen-int4-GPTQ-python-code
Upload LlamaForCausalLM
Browse files- config.json +49 -0
- generation_config.json +7 -0
- pytorch_model.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "edumunozsala/llama-2-7b-int4-python-code-20k",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 4096,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 11008,
|
| 13 |
+
"max_position_embeddings": 4096,
|
| 14 |
+
"model_type": "llama",
|
| 15 |
+
"num_attention_heads": 32,
|
| 16 |
+
"num_hidden_layers": 32,
|
| 17 |
+
"num_key_value_heads": 32,
|
| 18 |
+
"pad_token_id": 0,
|
| 19 |
+
"pretraining_tp": 1,
|
| 20 |
+
"quantization_config": {
|
| 21 |
+
"batch_size": 1,
|
| 22 |
+
"bits": 4,
|
| 23 |
+
"block_name_to_quantize": "model.layers",
|
| 24 |
+
"damp_percent": 0.1,
|
| 25 |
+
"dataset": "c4",
|
| 26 |
+
"desc_act": false,
|
| 27 |
+
"disable_exllama": false,
|
| 28 |
+
"group_size": 128,
|
| 29 |
+
"max_input_length": null,
|
| 30 |
+
"model_seqlen": 4096,
|
| 31 |
+
"module_name_preceding_first_block": [
|
| 32 |
+
"model.embed_tokens"
|
| 33 |
+
],
|
| 34 |
+
"pad_token_id": null,
|
| 35 |
+
"quant_method": "gptq",
|
| 36 |
+
"sym": true,
|
| 37 |
+
"tokenizer": null,
|
| 38 |
+
"true_sequential": true,
|
| 39 |
+
"use_cuda_fp16": true
|
| 40 |
+
},
|
| 41 |
+
"rms_norm_eps": 1e-05,
|
| 42 |
+
"rope_scaling": null,
|
| 43 |
+
"rope_theta": 10000.0,
|
| 44 |
+
"tie_word_embeddings": false,
|
| 45 |
+
"torch_dtype": "float16",
|
| 46 |
+
"transformers_version": "4.34.1",
|
| 47 |
+
"use_cache": true,
|
| 48 |
+
"vocab_size": 32000
|
| 49 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.34.1"
|
| 7 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a2005b86b4a899ccd54d4a5f651294f2c3e3372eacc7854a5ca62aff842234e1
|
| 3 |
+
size 3896979412
|