Text Generation
Transformers
Chinese
English
Context
Qwen2.5-7B-Instruct-GPTQ-INT8
Qwen2.5-7B-Instruct-GPTQ-INT4
Instructions to use AXERA-TECH/Qwen2.5-7B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AXERA-TECH/Qwen2.5-7B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AXERA-TECH/Qwen2.5-7B-Instruct")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AXERA-TECH/Qwen2.5-7B-Instruct", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AXERA-TECH/Qwen2.5-7B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AXERA-TECH/Qwen2.5-7B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AXERA-TECH/Qwen2.5-7B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AXERA-TECH/Qwen2.5-7B-Instruct
- SGLang
How to use AXERA-TECH/Qwen2.5-7B-Instruct 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 "AXERA-TECH/Qwen2.5-7B-Instruct" \ --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": "AXERA-TECH/Qwen2.5-7B-Instruct", "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 "AXERA-TECH/Qwen2.5-7B-Instruct" \ --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": "AXERA-TECH/Qwen2.5-7B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AXERA-TECH/Qwen2.5-7B-Instruct with Docker Model Runner:
docker model run hf.co/AXERA-TECH/Qwen2.5-7B-Instruct
add run_qwen2.5_7b_ctx_int4_axcl_aarch64_api.sh
#1
by nickshek - opened
run_qwen2.5_7b_ctx_int4_axcl_aarch64_api.sh
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
./main_api_axcl_aarch64 \
|
| 2 |
+
--template_filename_axmodel "qwen2.5-7b-ctx-int4-ax650/qwen2_p128_l%d_together.axmodel" \
|
| 3 |
+
--axmodel_num 28 \
|
| 4 |
+
--url_tokenizer_model "http://0.0.0.0:12345" \
|
| 5 |
+
--filename_post_axmodel "qwen2.5-7b-ctx-int4-ax650/qwen2_post.axmodel" \
|
| 6 |
+
--filename_tokens_embed "qwen2.5-7b-ctx-int4-ax650/model.embed_tokens.weight.bfloat16.bin" \
|
| 7 |
+
--tokens_embed_num 152064 \
|
| 8 |
+
--tokens_embed_size 3584 \
|
| 9 |
+
--use_mmap_load_embed 1 \
|
| 10 |
+
--devices 0
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
#--system_prompt "你的名字叫小智(allen),你是一个人畜无害的AI助手。深圳市今天(4月1日)阴天,愚人节,气温在14°C至19°C之间,微风。" \
|
| 14 |
+
#--kvcache_path "./kvcache" \
|
| 15 |
+
|