Text Generation
Transformers
Safetensors
Korean
English
exaone_moe
Mixture of Experts
awq
quantized
w4a16
compressed-tensors
vllm
llm-compressor
conversational
Instructions to use Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128") model = AutoModelForCausalLM.from_pretrained("Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128
- SGLang
How to use Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 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 "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128 with Docker Model Runner:
docker model run hf.co/Hyun9junn/K-EXAONE-236B-A23B-W4A16-G128
Add files using upload-large-folder tool
Browse files- config.json +1 -1
- generation_config.json +1 -1
- model-00001-of-00003.safetensors +1 -1
- model-00002-of-00003.safetensors +1 -1
- model-00003-of-00003.safetensors +1 -1
- recipe.yaml +1 -4
config.json
CHANGED
|
@@ -224,7 +224,7 @@
|
|
| 224 |
"tie_word_embeddings": false,
|
| 225 |
"tokenizer_class": "GPT2Tokenizer",
|
| 226 |
"topk_group": 1,
|
| 227 |
-
"transformers_version": "5.5.
|
| 228 |
"use_cache": true,
|
| 229 |
"vocab_size": 153600
|
| 230 |
}
|
|
|
|
| 224 |
"tie_word_embeddings": false,
|
| 225 |
"tokenizer_class": "GPT2Tokenizer",
|
| 226 |
"topk_group": 1,
|
| 227 |
+
"transformers_version": "5.5.3",
|
| 228 |
"use_cache": true,
|
| 229 |
"vocab_size": 153600
|
| 230 |
}
|
generation_config.json
CHANGED
|
@@ -6,5 +6,5 @@
|
|
| 6 |
"pad_token_id": 0,
|
| 7 |
"temperature": 1.0,
|
| 8 |
"top_p": 0.95,
|
| 9 |
-
"transformers_version": "5.5.
|
| 10 |
}
|
|
|
|
| 6 |
"pad_token_id": 0,
|
| 7 |
"temperature": 1.0,
|
| 8 |
"top_p": 0.95,
|
| 9 |
+
"transformers_version": "5.5.3"
|
| 10 |
}
|
model-00001-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 49999847240
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46ea2df2017ceacabbf473948c1dede534686cb60d8882de32aaac3c4ec115ca
|
| 3 |
size 49999847240
|
model-00002-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 49999543336
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:62134a3298a764d8c0abf913368494049f13067b7c91bfd3f720d830e094922e
|
| 3 |
size 49999543336
|
model-00003-of-00003.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 24847289304
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4eed6b53a62c2c25af6fb5f2ef0d3d41ac634a4d0432e43815aded265492d627
|
| 3 |
size 24847289304
|
recipe.yaml
CHANGED
|
@@ -6,9 +6,6 @@ default_stage:
|
|
| 6 |
scheme: W4A16
|
| 7 |
bypass_divisibility_checks: false
|
| 8 |
mappings:
|
| 9 |
-
- smooth_layer: re:.*v_proj$
|
| 10 |
-
balance_layers: ['re:.*o_proj$']
|
| 11 |
-
activation_hook_target: null
|
| 12 |
- smooth_layer: model.layers.1.post_attention_layernorm
|
| 13 |
balance_layers: ['re:model\.layers\.1\.mlp\.experts\.[0-9]+\.gate_proj$', 're:model\.layers\.1\.mlp\.experts\.[0-9]+\.up_proj$',
|
| 14 |
model.layers.1.mlp.shared_experts.gate_proj, model.layers.1.mlp.shared_experts.up_proj]
|
|
@@ -203,4 +200,4 @@ default_stage:
|
|
| 203 |
offload_device: !!python/object/apply:torch.device [cpu]
|
| 204 |
duo_scaling: true
|
| 205 |
n_grid: 20
|
| 206 |
-
cache_chunk_size_batches:
|
|
|
|
| 6 |
scheme: W4A16
|
| 7 |
bypass_divisibility_checks: false
|
| 8 |
mappings:
|
|
|
|
|
|
|
|
|
|
| 9 |
- smooth_layer: model.layers.1.post_attention_layernorm
|
| 10 |
balance_layers: ['re:model\.layers\.1\.mlp\.experts\.[0-9]+\.gate_proj$', 're:model\.layers\.1\.mlp\.experts\.[0-9]+\.up_proj$',
|
| 11 |
model.layers.1.mlp.shared_experts.gate_proj, model.layers.1.mlp.shared_experts.up_proj]
|
|
|
|
| 200 |
offload_device: !!python/object/apply:torch.device [cpu]
|
| 201 |
duo_scaling: true
|
| 202 |
n_grid: 20
|
| 203 |
+
cache_chunk_size_batches: 16
|