Instructions to use Michielo/mt5-small_en-nl_translation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Michielo/mt5-small_en-nl_translation with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Michielo/mt5-small_en-nl_translation")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Michielo/mt5-small_en-nl_translation") model = AutoModelForSeq2SeqLM.from_pretrained("Michielo/mt5-small_en-nl_translation", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Michielo/mt5-small_en-nl_translation with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Michielo/mt5-small_en-nl_translation" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Michielo/mt5-small_en-nl_translation", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Michielo/mt5-small_en-nl_translation
- SGLang
How to use Michielo/mt5-small_en-nl_translation 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 "Michielo/mt5-small_en-nl_translation" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Michielo/mt5-small_en-nl_translation", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Michielo/mt5-small_en-nl_translation" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Michielo/mt5-small_en-nl_translation", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Michielo/mt5-small_en-nl_translation with Docker Model Runner:
docker model run hf.co/Michielo/mt5-small_en-nl_translation
Improved model output quality
Browse files- config.json +2 -2
- generation_config.json +1 -1
- model.safetensors +1 -1
- tokenizer.json +2 -2
- tokenizer_config.json +4 -0
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"MT5ForConditionalGeneration"
|
| 5 |
],
|
|
@@ -27,7 +27,7 @@
|
|
| 27 |
"tie_word_embeddings": false,
|
| 28 |
"tokenizer_class": "T5Tokenizer",
|
| 29 |
"torch_dtype": "float32",
|
| 30 |
-
"transformers_version": "4.
|
| 31 |
"use_cache": true,
|
| 32 |
"vocab_size": 250112
|
| 33 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "output/checkpointt",
|
| 3 |
"architectures": [
|
| 4 |
"MT5ForConditionalGeneration"
|
| 5 |
],
|
|
|
|
| 27 |
"tie_word_embeddings": false,
|
| 28 |
"tokenizer_class": "T5Tokenizer",
|
| 29 |
"torch_dtype": "float32",
|
| 30 |
+
"transformers_version": "4.39.3",
|
| 31 |
"use_cache": true,
|
| 32 |
"vocab_size": 250112
|
| 33 |
}
|
generation_config.json
CHANGED
|
@@ -3,5 +3,5 @@
|
|
| 3 |
"eos_token_id": 1,
|
| 4 |
"max_length": 1024,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
-
"transformers_version": "4.
|
| 7 |
}
|
|
|
|
| 3 |
"eos_token_id": 1,
|
| 4 |
"max_length": 1024,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.39.3"
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1200729512
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6e8f097617c6f3379785eb4edbd501d52d2c4c876c142c7f85c114fa489309e
|
| 3 |
size 1200729512
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bb8aa17e32492b66346653b8954cf4c01f46717f63fd0c44b4c2d9fa36276392
|
| 3 |
+
size 16315413
|
tokenizer_config.json
CHANGED
|
@@ -30,9 +30,13 @@
|
|
| 30 |
"eos_token": "</s>",
|
| 31 |
"extra_ids": 0,
|
| 32 |
"legacy": true,
|
|
|
|
| 33 |
"model_max_length": 1024,
|
| 34 |
"pad_token": "<pad>",
|
| 35 |
"sp_model_kwargs": {},
|
|
|
|
| 36 |
"tokenizer_class": "T5Tokenizer",
|
|
|
|
|
|
|
| 37 |
"unk_token": "<unk>"
|
| 38 |
}
|
|
|
|
| 30 |
"eos_token": "</s>",
|
| 31 |
"extra_ids": 0,
|
| 32 |
"legacy": true,
|
| 33 |
+
"max_length": 1024,
|
| 34 |
"model_max_length": 1024,
|
| 35 |
"pad_token": "<pad>",
|
| 36 |
"sp_model_kwargs": {},
|
| 37 |
+
"stride": 0,
|
| 38 |
"tokenizer_class": "T5Tokenizer",
|
| 39 |
+
"truncation_side": "right",
|
| 40 |
+
"truncation_strategy": "longest_first",
|
| 41 |
"unk_token": "<unk>"
|
| 42 |
}
|