Instructions to use tencent/Hunyuan-MT-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hunyuan-MT-7B with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("translation", model="tencent/Hunyuan-MT-7B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tencent/Hunyuan-MT-7B") model = AutoModelForCausalLM.from_pretrained("tencent/Hunyuan-MT-7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download tokenizer_config.json from tencent/Hunyuan-MT-7B: direct link, hf CLI and curl.
- Browser
- Download file 892 Bytes
-
https://huggingface.co/tencent/Hunyuan-MT-7B/resolve/main/tokenizer_config.json
- Command line
-
hf download hf://tencent/Hunyuan-MT-7B/tokenizer_config.json
-
curl -L -o tokenizer_config.json https://huggingface.co/tencent/Hunyuan-MT-7B/resolve/main/tokenizer_config.json
892 Bytes
| { | |
| "bos_token": "<|startoftext|>", | |
| "clean_up_tokenization_spaces": true, | |
| "eos_token": "<|eos|>", | |
| "model_max_length": 262144, | |
| "pad_token": "<|pad|>", | |
| "tokenizer_class": "PreTrainedTokenizerFast", | |
| "chat_template": "{% set ns = namespace(has_head=true) %}{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = message['content'] %}{% if loop.index0 == 0 %}{% if content == '' %}{% set ns.has_head = false %}{% elif message['role'] == 'system' %}{% set content = '<|startoftext|>' + content + '<|extra_4|>' %}{% endif %}{% endif %}{% if message['role'] == 'user' %}{% if loop.index0 == 1 and ns.has_head %}{% set content = content + '<|extra_0|>' %}{% else %}{% set content = '<|startoftext|>' + content + '<|extra_0|>' %}{% endif %}{% elif message['role'] == 'assistant' %}{% set content = content + '<|eos|>' %}{% endif %}{{ content }}{% endfor %}" | |
| } | |