Instructions to use tencent/Hunyuan-A13B-Instruct-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hunyuan-A13B-Instruct-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/Hunyuan-A13B-Instruct-FP8", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("tencent/Hunyuan-A13B-Instruct-FP8", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tencent/Hunyuan-A13B-Instruct-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/Hunyuan-A13B-Instruct-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tencent/Hunyuan-A13B-Instruct-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/Hunyuan-A13B-Instruct-FP8
- SGLang
How to use tencent/Hunyuan-A13B-Instruct-FP8 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 "tencent/Hunyuan-A13B-Instruct-FP8" \ --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": "tencent/Hunyuan-A13B-Instruct-FP8", "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 "tencent/Hunyuan-A13B-Instruct-FP8" \ --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": "tencent/Hunyuan-A13B-Instruct-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/Hunyuan-A13B-Instruct-FP8 with Docker Model Runner:
docker model run hf.co/tencent/Hunyuan-A13B-Instruct-FP8
Upload config.json with huggingface_hub
Browse files- config.json +4 -5
config.json
CHANGED
|
@@ -1,19 +1,18 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "/apdcephfs_gy2/share_302508627/darrenhu/llm/model/open_A13B/7b_moe_t1_v53_long_context_stage_daxianwang_fix_renshe_hf",
|
| 3 |
"add_classification_head": false,
|
| 4 |
"anyres_pooling_size": 2,
|
| 5 |
"anyres_vit_max_image_size": null,
|
| 6 |
"anyres_vit_two_views": false,
|
| 7 |
"architectures": [
|
| 8 |
-
"
|
| 9 |
],
|
| 10 |
"attention_bias": false,
|
| 11 |
"attention_dropout": 0.1,
|
| 12 |
"attention_head_dim": 128,
|
| 13 |
"auto_map": {
|
| 14 |
"AutoConfig": "configuration_hunyuan.HunYuanConfig",
|
| 15 |
-
"AutoModel": "hunyuan.
|
| 16 |
-
"AutoModelForCausalLM": "hunyuan.
|
| 17 |
},
|
| 18 |
"bos_token_id": 1,
|
| 19 |
"cla_share_factor": 2,
|
|
@@ -187,7 +186,7 @@
|
|
| 187 |
"topk_group": null,
|
| 188 |
"torch_dtype": "bfloat16",
|
| 189 |
"transformers_version": "4.41.2",
|
| 190 |
-
"use_cache":
|
| 191 |
"use_cla": false,
|
| 192 |
"use_mixed_mlp_moe": true,
|
| 193 |
"use_mla": false,
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"add_classification_head": false,
|
| 3 |
"anyres_pooling_size": 2,
|
| 4 |
"anyres_vit_max_image_size": null,
|
| 5 |
"anyres_vit_two_views": false,
|
| 6 |
"architectures": [
|
| 7 |
+
"HunYuanMoEV1ForCausalLM"
|
| 8 |
],
|
| 9 |
"attention_bias": false,
|
| 10 |
"attention_dropout": 0.1,
|
| 11 |
"attention_head_dim": 128,
|
| 12 |
"auto_map": {
|
| 13 |
"AutoConfig": "configuration_hunyuan.HunYuanConfig",
|
| 14 |
+
"AutoModel": "hunyuan.HunYuanModel",
|
| 15 |
+
"AutoModelForCausalLM": "hunyuan.HunYuanMoEV1ForCausalLM"
|
| 16 |
},
|
| 17 |
"bos_token_id": 1,
|
| 18 |
"cla_share_factor": 2,
|
|
|
|
| 186 |
"topk_group": null,
|
| 187 |
"torch_dtype": "bfloat16",
|
| 188 |
"transformers_version": "4.41.2",
|
| 189 |
+
"use_cache": true,
|
| 190 |
"use_cla": false,
|
| 191 |
"use_mixed_mlp_moe": true,
|
| 192 |
"use_mla": false,
|