Text Generation
Transformers
Safetensors
English
Chinese
glm4_moe_lite
vLLM
AWQ
conversational
4-bit precision
awq
Instructions to use QuantTrio/GLM-4.7-Flash-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuantTrio/GLM-4.7-Flash-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuantTrio/GLM-4.7-Flash-AWQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("QuantTrio/GLM-4.7-Flash-AWQ") model = AutoModelForCausalLM.from_pretrained("QuantTrio/GLM-4.7-Flash-AWQ") 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
- vLLM
How to use QuantTrio/GLM-4.7-Flash-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantTrio/GLM-4.7-Flash-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": "QuantTrio/GLM-4.7-Flash-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantTrio/GLM-4.7-Flash-AWQ
- SGLang
How to use QuantTrio/GLM-4.7-Flash-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 "QuantTrio/GLM-4.7-Flash-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": "QuantTrio/GLM-4.7-Flash-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 "QuantTrio/GLM-4.7-Flash-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": "QuantTrio/GLM-4.7-Flash-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use QuantTrio/GLM-4.7-Flash-AWQ with Docker Model Runner:
docker model run hf.co/QuantTrio/GLM-4.7-Flash-AWQ
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,19 +4,19 @@ language:
|
|
| 4 |
- zh
|
| 5 |
library_name: transformers
|
| 6 |
license: mit
|
|
|
|
| 7 |
tasks:
|
| 8 |
- text-generation
|
| 9 |
frameworks: PyTorch
|
| 10 |
-
pipeline_tag: text-to-text
|
| 11 |
tags:
|
| 12 |
- vLLM
|
| 13 |
- AWQ
|
| 14 |
base_model:
|
| 15 |
-
-
|
| 16 |
base_model_relation: quantized
|
| 17 |
---
|
| 18 |
# GLM-4.7-Flash-AWQ
|
| 19 |
-
Base model: [
|
| 20 |
|
| 21 |
|
| 22 |
### 【Dependencies / Installation】
|
|
@@ -42,7 +42,7 @@ export VLLM_USE_FLASHINFER_SAMPLER=0
|
|
| 42 |
export OMP_NUM_THREADS=4
|
| 43 |
|
| 44 |
vllm serve \
|
| 45 |
-
__YOUR_PATH__/
|
| 46 |
--served-model-name MY_MODEL_NAME \
|
| 47 |
--swap-space 4 \
|
| 48 |
--max-model-len 32768 \
|
|
@@ -72,8 +72,8 @@ vllm serve \
|
|
| 72 |
|
| 73 |
### 【Model Download】
|
| 74 |
```python
|
| 75 |
-
from
|
| 76 |
-
snapshot_download('
|
| 77 |
```
|
| 78 |
|
| 79 |
### 【Overview】
|
|
|
|
| 4 |
- zh
|
| 5 |
library_name: transformers
|
| 6 |
license: mit
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
tasks:
|
| 9 |
- text-generation
|
| 10 |
frameworks: PyTorch
|
|
|
|
| 11 |
tags:
|
| 12 |
- vLLM
|
| 13 |
- AWQ
|
| 14 |
base_model:
|
| 15 |
+
- zai-org/GLM-4.7-Flash
|
| 16 |
base_model_relation: quantized
|
| 17 |
---
|
| 18 |
# GLM-4.7-Flash-AWQ
|
| 19 |
+
Base model: [zai-org/GLM-4.7-Flash](https://huggingface.co/zai-org/GLM-4.7-Flash)
|
| 20 |
|
| 21 |
|
| 22 |
### 【Dependencies / Installation】
|
|
|
|
| 42 |
export OMP_NUM_THREADS=4
|
| 43 |
|
| 44 |
vllm serve \
|
| 45 |
+
__YOUR_PATH__/QuantTrio/GLM-4.7-Flash-AWQ \
|
| 46 |
--served-model-name MY_MODEL_NAME \
|
| 47 |
--swap-space 4 \
|
| 48 |
--max-model-len 32768 \
|
|
|
|
| 72 |
|
| 73 |
### 【Model Download】
|
| 74 |
```python
|
| 75 |
+
from huggingface_hub import snapshot_download
|
| 76 |
+
snapshot_download('QuantTrio/GLM-4.7-Flash-AWQ', cache_dir="your_local_path")
|
| 77 |
```
|
| 78 |
|
| 79 |
### 【Overview】
|