Text Generation
Transformers
Safetensors
English
Korean
Spanish
exaone4
lg-ai
exaone
exaone-4.0
conversational
4-bit precision
awq
Instructions to use LGAI-EXAONE/EXAONE-4.0-32B-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LGAI-EXAONE/EXAONE-4.0-32B-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LGAI-EXAONE/EXAONE-4.0-32B-AWQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LGAI-EXAONE/EXAONE-4.0-32B-AWQ") model = AutoModelForCausalLM.from_pretrained("LGAI-EXAONE/EXAONE-4.0-32B-AWQ", device_map="auto") 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 LGAI-EXAONE/EXAONE-4.0-32B-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LGAI-EXAONE/EXAONE-4.0-32B-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LGAI-EXAONE/EXAONE-4.0-32B-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LGAI-EXAONE/EXAONE-4.0-32B-AWQ
- SGLang
How to use LGAI-EXAONE/EXAONE-4.0-32B-AWQ 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 "LGAI-EXAONE/EXAONE-4.0-32B-AWQ" \ --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": "LGAI-EXAONE/EXAONE-4.0-32B-AWQ", "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 "LGAI-EXAONE/EXAONE-4.0-32B-AWQ" \ --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": "LGAI-EXAONE/EXAONE-4.0-32B-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LGAI-EXAONE/EXAONE-4.0-32B-AWQ with Docker Model Runner:
docker model run hf.co/LGAI-EXAONE/EXAONE-4.0-32B-AWQ
Commit ·
2d523b2
1
Parent(s): ab78a17
Update HuggingFace transformers support
Browse files- README.md +2 -8
- config.json +67 -1
- generation_config.json +1 -1
README.md
CHANGED
|
@@ -20,6 +20,7 @@ library_name: transformers
|
|
| 20 |
<img src="assets/EXAONE_Symbol+BI_3d.png", width="300", style="margin: 40 auto;">
|
| 21 |
🎉 License Updated! We are pleased to announce our more flexible licensing terms 🤗
|
| 22 |
<br>✈️ Try on <a href="https://friendli.ai/suite/~/serverless-endpoints/LGAI-EXAONE/EXAONE-4.0-32B/overview">FriendliAI</a>
|
|
|
|
| 23 |
<br>
|
| 24 |
|
| 25 |
# EXAONE-4.0-32B-AWQ
|
|
@@ -50,14 +51,7 @@ For more details, please refer to our [technical report](https://arxiv.org/abs/2
|
|
| 50 |
|
| 51 |
## Quickstart
|
| 52 |
|
| 53 |
-
You should install the transformers library
|
| 54 |
-
Once this PR is merged and released, we will update this section.
|
| 55 |
-
|
| 56 |
-
You can install the latest version of transformers with support for EXAONE 4.0 by following the command:
|
| 57 |
-
|
| 58 |
-
```bash
|
| 59 |
-
pip install git+https://github.com/lgai-exaone/transformers@add-exaone4
|
| 60 |
-
```
|
| 61 |
|
| 62 |
### Non-reasoning mode
|
| 63 |
|
|
|
|
| 20 |
<img src="assets/EXAONE_Symbol+BI_3d.png", width="300", style="margin: 40 auto;">
|
| 21 |
🎉 License Updated! We are pleased to announce our more flexible licensing terms 🤗
|
| 22 |
<br>✈️ Try on <a href="https://friendli.ai/suite/~/serverless-endpoints/LGAI-EXAONE/EXAONE-4.0-32B/overview">FriendliAI</a>
|
| 23 |
+
<br><br><i>📢 EXAONE 4.0 is officially supported by HuggingFace transformers! Please check out the guide <a href="#quickstart">below</a></i>
|
| 24 |
<br>
|
| 25 |
|
| 26 |
# EXAONE-4.0-32B-AWQ
|
|
|
|
| 51 |
|
| 52 |
## Quickstart
|
| 53 |
|
| 54 |
+
You should install the transformers library with version >= `4.54.0`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
### Non-reasoning mode
|
| 57 |
|
config.json
CHANGED
|
@@ -10,6 +10,72 @@
|
|
| 10 |
"hidden_size": 5120,
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
"intermediate_size": 27392,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
"max_position_embeddings": 131072,
|
| 14 |
"model_type": "exaone4",
|
| 15 |
"num_attention_heads": 40,
|
|
@@ -39,7 +105,7 @@
|
|
| 39 |
"sliding_window_pattern": "LLLG",
|
| 40 |
"tie_word_embeddings": false,
|
| 41 |
"torch_dtype": "bfloat16",
|
| 42 |
-
"transformers_version": "4.54.0
|
| 43 |
"use_cache": false,
|
| 44 |
"vocab_size": 102400
|
| 45 |
}
|
|
|
|
| 10 |
"hidden_size": 5120,
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
"intermediate_size": 27392,
|
| 13 |
+
"layer_types": [
|
| 14 |
+
"sliding_attention",
|
| 15 |
+
"sliding_attention",
|
| 16 |
+
"sliding_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"sliding_attention",
|
| 19 |
+
"sliding_attention",
|
| 20 |
+
"sliding_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"sliding_attention",
|
| 23 |
+
"sliding_attention",
|
| 24 |
+
"sliding_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"sliding_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"sliding_attention",
|
| 31 |
+
"sliding_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"sliding_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"sliding_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"sliding_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"sliding_attention",
|
| 53 |
+
"full_attention",
|
| 54 |
+
"sliding_attention",
|
| 55 |
+
"sliding_attention",
|
| 56 |
+
"sliding_attention",
|
| 57 |
+
"full_attention",
|
| 58 |
+
"sliding_attention",
|
| 59 |
+
"sliding_attention",
|
| 60 |
+
"sliding_attention",
|
| 61 |
+
"full_attention",
|
| 62 |
+
"sliding_attention",
|
| 63 |
+
"sliding_attention",
|
| 64 |
+
"sliding_attention",
|
| 65 |
+
"full_attention",
|
| 66 |
+
"sliding_attention",
|
| 67 |
+
"sliding_attention",
|
| 68 |
+
"sliding_attention",
|
| 69 |
+
"full_attention",
|
| 70 |
+
"sliding_attention",
|
| 71 |
+
"sliding_attention",
|
| 72 |
+
"sliding_attention",
|
| 73 |
+
"full_attention",
|
| 74 |
+
"sliding_attention",
|
| 75 |
+
"sliding_attention",
|
| 76 |
+
"sliding_attention",
|
| 77 |
+
"full_attention"
|
| 78 |
+
],
|
| 79 |
"max_position_embeddings": 131072,
|
| 80 |
"model_type": "exaone4",
|
| 81 |
"num_attention_heads": 40,
|
|
|
|
| 105 |
"sliding_window_pattern": "LLLG",
|
| 106 |
"tie_word_embeddings": false,
|
| 107 |
"torch_dtype": "bfloat16",
|
| 108 |
+
"transformers_version": "4.54.0",
|
| 109 |
"use_cache": false,
|
| 110 |
"vocab_size": 102400
|
| 111 |
}
|
generation_config.json
CHANGED
|
@@ -5,5 +5,5 @@
|
|
| 5 |
"do_sample": true,
|
| 6 |
"eos_token_id": 361,
|
| 7 |
"pad_token_id": 0,
|
| 8 |
-
"transformers_version": "4.54.0
|
| 9 |
}
|
|
|
|
| 5 |
"do_sample": true,
|
| 6 |
"eos_token_id": 361,
|
| 7 |
"pad_token_id": 0,
|
| 8 |
+
"transformers_version": "4.54.0"
|
| 9 |
}
|