Instructions to use tencent/Hy3-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hy3-preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/Hy3-preview") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tencent/Hy3-preview") model = AutoModelForCausalLM.from_pretrained("tencent/Hy3-preview", 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 tencent/Hy3-preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/Hy3-preview" # 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/Hy3-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/Hy3-preview
- SGLang
How to use tencent/Hy3-preview 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/Hy3-preview" \ --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/Hy3-preview", "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/Hy3-preview" \ --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/Hy3-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/Hy3-preview with Docker Model Runner:
docker model run hf.co/tencent/Hy3-preview
Add files using upload-large-folder tool
Browse files- model-00009-of-00112.safetensors +3 -0
- model-00035-of-00112.safetensors +3 -0
- model-00037-of-00112.safetensors +3 -0
- model-00065-of-00112.safetensors +3 -0
- model-00067-of-00112.safetensors +3 -0
- model-00071-of-00112.safetensors +3 -0
- model-00075-of-00112.safetensors +3 -0
- model-00078-of-00112.safetensors +3 -0
- model-00079-of-00112.safetensors +3 -0
- model-00080-of-00112.safetensors +3 -0
- model-00094-of-00112.safetensors +3 -0
- model-00098-of-00112.safetensors +3 -0
- model-00108-of-00112.safetensors +3 -0
model-00009-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c61b6dcf801b2708a457c108d15126e38c8bd8b8337318c62875dec5e6478632
|
| 3 |
+
size 5360373880
|
model-00035-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69de4a9a83282a408cb41737a7263f74abbfc676ecc0d0e60ac44dbb9e73d081
|
| 3 |
+
size 5360373928
|
model-00037-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dd4a85ddd670e4964468183064e096ee7aaaa13f68536f855570d0dd16a8ff81
|
| 3 |
+
size 5360373872
|
model-00065-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed5e16b5a85a5d71eca3da20aff9ec53b81aaff9f6bc4d61617379f2fc28e36f
|
| 3 |
+
size 5360374000
|
model-00067-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d3138f9d630be731389fe6428277b4569c4528e3a16b408f44f5fabe1291a4ea
|
| 3 |
+
size 5360373912
|
model-00071-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6aca765df6840d98e20c4436493c57578e4b4fcd399f08c57f714d6649598e6a
|
| 3 |
+
size 5360373680
|
model-00075-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9b472a695e1931de9b4fb711008c083eedd81957c417e95a6c3ac5c93ab68db8
|
| 3 |
+
size 5360374064
|
model-00078-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f6afdb3adeaa29d1b46108bef7379392f68ff495bf140bedae494f8f4b4f57ef
|
| 3 |
+
size 5360373960
|
model-00079-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4769705898ff24e43963dcd1b71ecedef4623ea1df0daa17ef0c02148d6536b
|
| 3 |
+
size 5360374080
|
model-00080-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5611873dc1d30225e3a5741857f8454278be58e2926f203ef74db1ceb5935ffe
|
| 3 |
+
size 5360373824
|
model-00094-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fcb19968426dd751650dc7ca44409586f56176dc20e6fa64308d88179cefd0da
|
| 3 |
+
size 5360373840
|
model-00098-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:48afa98b10b8e9d8b33e0465e34bf06bafd4c9826cbbf568c65325f9053ebdf6
|
| 3 |
+
size 5360802872
|
model-00108-of-00112.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65fe46b72af7e2d84e98e4a77204c871a9cd74260e9dc6d766892ad1c8455b26
|
| 3 |
+
size 5360373848
|