Instructions to use m-i/HY-MT1.5-1.8B-mlx-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use m-i/HY-MT1.5-1.8B-mlx-fp16 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="m-i/HY-MT1.5-1.8B-mlx-fp16")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("m-i/HY-MT1.5-1.8B-mlx-fp16") model = AutoModelForCausalLM.from_pretrained("m-i/HY-MT1.5-1.8B-mlx-fp16") - MLX
How to use m-i/HY-MT1.5-1.8B-mlx-fp16 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir HY-MT1.5-1.8B-mlx-fp16 m-i/HY-MT1.5-1.8B-mlx-fp16
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
tags:
|
| 4 |
+
- translation
|
| 5 |
+
- mlx
|
| 6 |
+
- mlx-my-repo
|
| 7 |
+
language:
|
| 8 |
+
- zh
|
| 9 |
+
- en
|
| 10 |
+
- fr
|
| 11 |
+
- pt
|
| 12 |
+
- es
|
| 13 |
+
- ja
|
| 14 |
+
- tr
|
| 15 |
+
- ru
|
| 16 |
+
- ar
|
| 17 |
+
- ko
|
| 18 |
+
- th
|
| 19 |
+
- it
|
| 20 |
+
- de
|
| 21 |
+
- vi
|
| 22 |
+
- ms
|
| 23 |
+
- id
|
| 24 |
+
- tl
|
| 25 |
+
- hi
|
| 26 |
+
- pl
|
| 27 |
+
- cs
|
| 28 |
+
- nl
|
| 29 |
+
- km
|
| 30 |
+
- my
|
| 31 |
+
- fa
|
| 32 |
+
- gu
|
| 33 |
+
- ur
|
| 34 |
+
- te
|
| 35 |
+
- mr
|
| 36 |
+
- he
|
| 37 |
+
- bn
|
| 38 |
+
- ta
|
| 39 |
+
- uk
|
| 40 |
+
- bo
|
| 41 |
+
- kk
|
| 42 |
+
- mn
|
| 43 |
+
- ug
|
| 44 |
+
base_model: tencent/HY-MT1.5-1.8B
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
# m-i/HY-MT1.5-1.8B-mlx-fp16
|
| 48 |
+
|
| 49 |
+
The Model [m-i/HY-MT1.5-1.8B-mlx-fp16](https://huggingface.co/m-i/HY-MT1.5-1.8B-mlx-fp16) was converted to MLX format from [tencent/HY-MT1.5-1.8B](https://huggingface.co/tencent/HY-MT1.5-1.8B) using mlx-lm version **0.28.3**.
|
| 50 |
+
|
| 51 |
+
## Use with mlx
|
| 52 |
+
|
| 53 |
+
```bash
|
| 54 |
+
pip install mlx-lm
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
from mlx_lm import load, generate
|
| 59 |
+
|
| 60 |
+
model, tokenizer = load("m-i/HY-MT1.5-1.8B-mlx-fp16")
|
| 61 |
+
|
| 62 |
+
prompt="hello"
|
| 63 |
+
|
| 64 |
+
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
|
| 65 |
+
messages = [{"role": "user", "content": prompt}]
|
| 66 |
+
prompt = tokenizer.apply_chat_template(
|
| 67 |
+
messages, tokenize=False, add_generation_prompt=True
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
| 71 |
+
```
|