Instructions to use tencent/Hunyuan-1.8B-Instruct-AWQ-Int4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hunyuan-1.8B-Instruct-AWQ-Int4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/Hunyuan-1.8B-Instruct-AWQ-Int4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tencent/Hunyuan-1.8B-Instruct-AWQ-Int4") model = AutoModelForCausalLM.from_pretrained("tencent/Hunyuan-1.8B-Instruct-AWQ-Int4", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tencent/Hunyuan-1.8B-Instruct-AWQ-Int4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/Hunyuan-1.8B-Instruct-AWQ-Int4" # 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-1.8B-Instruct-AWQ-Int4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/Hunyuan-1.8B-Instruct-AWQ-Int4
- SGLang
How to use tencent/Hunyuan-1.8B-Instruct-AWQ-Int4 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-1.8B-Instruct-AWQ-Int4" \ --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-1.8B-Instruct-AWQ-Int4", "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-1.8B-Instruct-AWQ-Int4" \ --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-1.8B-Instruct-AWQ-Int4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/Hunyuan-1.8B-Instruct-AWQ-Int4 with Docker Model Runner:
docker model run hf.co/tencent/Hunyuan-1.8B-Instruct-AWQ-Int4
Commit History
-
Update README.md
Verified signature2d5ff8d -
Update README.md
Verified signature42cffe7
-
Upload README_CN.md with huggingface_hub
Verified signatured2cda6d -
Upload README.md with huggingface_hub
Verified signaturea960c82 -
Upload README_CN.md with huggingface_hub
Verified signatureb6e7a54 -
Upload README.md with huggingface_hub
Verified signature5a66115 -
Upload tokenizer_config.json with huggingface_hub
Verified signatured716399
-
Upload LICENSE with huggingface_hub
Verified signaturec5305d7
-
Update README.md (#2)
Verified signature- Update README.md (616272ee7f0fcc3d14c5cb1963ae907d934333f6) Co-authored-by: woodchen <woodchen7@users.noreply.huggingface.co>0cb565a -
Update README.md
Verified signature7eb4164 -
Update README.md
Verified signature34d341f -
Upload README.md with huggingface_hub
Verified signaturedd57ce8 -
Upload README.md with huggingface_hub
Verified signature3b5d6d7 -
Upload LICENSE with huggingface_hub
Verified signaturee0b7464 -
Update README.md
Verified signature45fb6d1 -
Update README.md
Verified signature2b92150 -
Upload tokenizer_config.json with huggingface_hub
Verified signature563ebad -
Upload requirements.txt with huggingface_hub
Verified signaturef11e2ad -
Upload README_CN.md with huggingface_hub
Verified signature16c9c86 -
Upload README.md with huggingface_hub
Verified signature28bf4a3 -
Upload Notice.txt with huggingface_hub
Verified signaturee77207e -
Upload LICENSE.txt with huggingface_hub
Verified signature34dcc2c
-
Upload tokenizer_config.json with huggingface_hub
Verified signaturea397a33 -
Upload tokenizer.json with huggingface_hub
Verified signature78c4ed5 -
Upload special_tokens_map.json with huggingface_hub
Verified signature0dc869d -
Upload model.safetensors with huggingface_hub
Verified signature01f249e -
Upload config.json with huggingface_hub
Verified signature70623fd -
Upload chat_template.jinja with huggingface_hub
Verified signature2b44b91 -
Upload angelslim_config.json with huggingface_hub
Verified signature1448721
-
initial commit
Verified signature8503f95