Instructions to use tencent/Hy-MT2-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hy-MT2-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/Hy-MT2-7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tencent/Hy-MT2-7B") model = AutoModelForCausalLM.from_pretrained("tencent/Hy-MT2-7B") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -41,4 +41,20 @@ We recommend using the following set of parameters for inference. Note that our
|
|
| 41 |
"repetition_penalty": 1.05,
|
| 42 |
"temperature": 0.7
|
| 43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
```
|
|
|
|
| 41 |
"repetition_penalty": 1.05,
|
| 42 |
"temperature": 0.7
|
| 43 |
}
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
### Use with vllm
|
| 47 |
+
|
| 48 |
+
Start the vLLM server:
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
vllm serve tencent/Hy-MT2-7B --tensor-parallel-size 1
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
### Use with sglang
|
| 55 |
+
|
| 56 |
+
Launch SGLang server:
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
python3 -m sglang.launch_server --model tencent/Hy-MT2-7B --tp 1
|
| 60 |
```
|