Translation
Transformers
Safetensors
English
Chinese
llama
text-generation
text-generation-inference
Run this model with HF Jobs
Run Mxode/NanoTranslator-XL on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Mxode/NanoTranslator-XL. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Mxode/NanoTranslator-XL on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Mxode/NanoTranslator-XL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mxode/NanoTranslator-XL 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="Mxode/NanoTranslator-XL")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Mxode/NanoTranslator-XL") model = AutoModelForCausalLM.from_pretrained("Mxode/NanoTranslator-XL", device_map="auto") - Notebooks
- Google Colab
- Kaggle
upload
Browse filesFiles changed (10)
- README.md+11-10
- README_zh-CN.md+11-10
- config.jsonAdded+28
- generation_config.jsonAdded+6
- model.safetensorsAdded+3
- result.logAdded+1
- special_tokens_map.jsonAdded+23
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+37
- trainer_state.jsonAdded
21 unmodified lines2223242526272829303132333446 unmodified lines8182838485868722 unmodified lines1101111121131141151167 unmodified lines12412512612712812913021 unmodified lines| | P. | Arch. | Act. | V. | H. | I. | L. | A.H. | K.H. | Tie || :--: | :-----: | :--: | :--: | :--: | :-----: | :---: | :------: | :--: | :--: | :--: || [XXL](https://huggingface.co/Mxode/NanoTranslator-XXL) | 100 | LLaMA | SwiGLU | 16000 | 768 | 4096 | 8 | 24 | 8 | True || [XL](https://huggingface.co/Mxode/NanoTranslator-XL) | 78 | LLaMA | GeGLU | 16000 | 768 | 4096 | 6 | 24 | 8 | True || [L](https://huggingface.co/Mxode/NanoTranslator-L) | 49 | LLaMA | GeGLU | 16000 | 512 | 2816 | 8 | 16 | 8 | True || [M2](https://huggingface.co/Mxode/NanoTranslator-M2) | 22 | Qwen2 | GeGLU | 4000 | 432 | 2304 | 6 | 24 | 8 | True || [M](https://huggingface.co/Mxode/NanoTranslator-M) | 22 | LLaMA | SwiGLU | 8000 | 256 | 1408 | 16 | 16 | 4 | True || [S](https://huggingface.co/Mxode/NanoTranslator-S) | 9 | LLaMA | SwiGLU | 4000 | 168 | 896 | 16 | 12 | 4 | True || [XS](https://huggingface.co/Mxode/NanoTranslator-XS) | 2 | LLaMA | SwiGLU | 2000 | 96 | 512 | 12 | 12 | 4 | True |- **P.** - Parameters (in million)- **V.** - vocab size46 unmodified linesresponse = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]return responsetext = "I love to watch my favorite TV series."response = translate(text, model, max_new_tokens=64, do_sample=False)print(response)22 unmodified linesort_model = ORTModelForCausalLM.from_pretrained(model_path)tokenizer = AutoTokenizer.from_pretrained(model_path)text = "I love to watch my favorite TV series."response = translate(text, ort_model, max_new_tokens=64, do_sample=False)print(response)7 unmodified linesmodel_path = "your/folder/to/onnx_model"pipe = pipeline("text-generation", model=model_path, accelerator="ort")text = "I love to watch my favorite TV series."response = pipe(text, max_new_tokens=64, do_sample=False)response21 unmodified lines222324252627282930313233343546 unmodified lines8283848586878822 unmodified lines1111121131141151161177 unmodified lines12512612712812913013121 unmodified lines| | P. | Arch. | Act. | V. | H. | I. | L. | A.H. | K.H. | Tie || :--: | :-----: | :--: | :--: | :--: | :-----: | :---: | :------: | :--: | :--: | :--: || [XXL2](https://huggingface.co/Mxode/NanoTranslator-XXL2) | 102 | LLaMA | SwiGLU | 16K | 1120 | 3072 | 6 | 16 | 8 | True || [XXL](https://huggingface.co/Mxode/NanoTranslator-XXL) | 100 | LLaMA | SwiGLU | 16K | 768 | 4096 | 8 | 24 | 8 | True || [XL](https://huggingface.co/Mxode/NanoTranslator-XL) | 78 | LLaMA | GeGLU | 16K | 768 | 4096 | 6 | 24 | 8 | True || [L](https://huggingface.co/Mxode/NanoTranslator-L) | 49 | LLaMA | GeGLU | 16K | 512 | 2816 | 8 | 16 | 8 | True || [M2](https://huggingface.co/Mxode/NanoTranslator-M2) | 22 | Qwen2 | GeGLU | 4K | 432 | 2304 | 6 | 24 | 8 | True || [M](https://huggingface.co/Mxode/NanoTranslator-M) | 22 | LLaMA | SwiGLU | 8K | 256 | 1408 | 16 | 16 | 4 | True || [S](https://huggingface.co/Mxode/NanoTranslator-S) | 9 | LLaMA | SwiGLU | 4K | 168 | 896 | 16 | 12 | 4 | True || [XS](https://huggingface.co/Mxode/NanoTranslator-XS) | 2 | LLaMA | SwiGLU | 2K | 96 | 512 | 12 | 12 | 4 | True |- **P.** - Parameters (in million)- **V.** - vocab size46 unmodified linesresponse = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]return responsetext = "Each step of the cell cycle is monitored by internal."response = translate(text, model, max_new_tokens=64, do_sample=False)print(response)22 unmodified linesort_model = ORTModelForCausalLM.from_pretrained(model_path)tokenizer = AutoTokenizer.from_pretrained(model_path)text = "Each step of the cell cycle is monitored by internal."response = translate(text, ort_model, max_new_tokens=64, do_sample=False)print(response)7 unmodified linesmodel_path = "your/folder/to/onnx_model"pipe = pipeline("text-generation", model=model_path, accelerator="ort")text = "Each step of the cell cycle is monitored by internal."response = pipe(text, max_new_tokens=64, do_sample=False)response
9 unmodified lines1011121314151617181920212246 unmodified lines6970717273747522 unmodified lines98991001011021031047 unmodified lines1121131141151161171189 unmodified lines| | P. | Arch. | Act. | V. | H. | I. | L. | A.H. | K.H. | Tie || :--: | :-----: | :--: | :--: | :--: | :-----: | :---: | :------: | :--: | :--: | :--: || [XXL](https://huggingface.co/Mxode/NanoTranslator-XXL) | 100 | LLaMA | SwiGLU | 16000 | 768 | 4096 | 8 | 24 | 8 | True || [XL](https://huggingface.co/Mxode/NanoTranslator-XL) | 78 | LLaMA | GeGLU | 16000 | 768 | 4096 | 6 | 24 | 8 | True || [L](https://huggingface.co/Mxode/NanoTranslator-L) | 49 | LLaMA | GeGLU | 16000 | 512 | 2816 | 8 | 16 | 8 | True || [M2](https://huggingface.co/Mxode/NanoTranslator-M2) | 22 | Qwen2 | GeGLU | 4000 | 432 | 2304 | 6 | 24 | 8 | True || [M](https://huggingface.co/Mxode/NanoTranslator-M) | 22 | LLaMA | SwiGLU | 8000 | 256 | 1408 | 16 | 16 | 4 | True || [S](https://huggingface.co/Mxode/NanoTranslator-S) | 9 | LLaMA | SwiGLU | 4000 | 168 | 896 | 16 | 12 | 4 | True || [XS](https://huggingface.co/Mxode/NanoTranslator-XS) | 2 | LLaMA | SwiGLU | 2000 | 96 | 512 | 12 | 12 | 4 | True |- **P.** - Parameters (in million)- **V.** - vocab size46 unmodified linesresponse = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]return responsetext = "I love to watch my favorite TV series."response = translate(text, model, max_new_tokens=64, do_sample=False)print(response)22 unmodified linesort_model = ORTModelForCausalLM.from_pretrained(model_path)tokenizer = AutoTokenizer.from_pretrained(model_path)text = "I love to watch my favorite TV series."response = translate(text, ort_model, max_new_tokens=64, do_sample=False)print(response)7 unmodified linesmodel_path = "your/folder/to/onnx_model"pipe = pipeline("text-generation", model=model_path, accelerator="ort")text = "I love to watch my favorite TV series."response = pipe(text, max_new_tokens=64, do_sample=False)response9 unmodified lines101112131415161718192021222346 unmodified lines7071727374757622 unmodified lines991001011021031041057 unmodified lines1131141151161171181199 unmodified lines| | P. | Arch. | Act. | V. | H. | I. | L. | A.H. | K.H. | Tie || :--: | :-----: | :--: | :--: | :--: | :-----: | :---: | :------: | :--: | :--: | :--: || [XXL2](https://huggingface.co/Mxode/NanoTranslator-XXL2) | 102 | LLaMA | SwiGLU | 16K | 1120 | 3072 | 6 | 16 | 8 | True || [XXL](https://huggingface.co/Mxode/NanoTranslator-XXL) | 100 | LLaMA | SwiGLU | 16K | 768 | 4096 | 8 | 24 | 8 | True || [XL](https://huggingface.co/Mxode/NanoTranslator-XL) | 78 | LLaMA | GeGLU | 16K | 768 | 4096 | 6 | 24 | 8 | True || [L](https://huggingface.co/Mxode/NanoTranslator-L) | 49 | LLaMA | GeGLU | 16K | 512 | 2816 | 8 | 16 | 8 | True || [M2](https://huggingface.co/Mxode/NanoTranslator-M2) | 22 | Qwen2 | GeGLU | 4K | 432 | 2304 | 6 | 24 | 8 | True || [M](https://huggingface.co/Mxode/NanoTranslator-M) | 22 | LLaMA | SwiGLU | 8K | 256 | 1408 | 16 | 16 | 4 | True || [S](https://huggingface.co/Mxode/NanoTranslator-S) | 9 | LLaMA | SwiGLU | 4K | 168 | 896 | 16 | 12 | 4 | True || [XS](https://huggingface.co/Mxode/NanoTranslator-XS) | 2 | LLaMA | SwiGLU | 2K | 96 | 512 | 12 | 12 | 4 | True |- **P.** - Parameters (in million)- **V.** - vocab size46 unmodified linesresponse = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]return responsetext = "Each step of the cell cycle is monitored by internal."response = translate(text, model, max_new_tokens=64, do_sample=False)print(response)22 unmodified linesort_model = ORTModelForCausalLM.from_pretrained(model_path)tokenizer = AutoTokenizer.from_pretrained(model_path)text = "Each step of the cell cycle is monitored by internal."response = translate(text, ort_model, max_new_tokens=64, do_sample=False)print(response)7 unmodified linesmodel_path = "your/folder/to/onnx_model"pipe = pipeline("text-generation", model=model_path, accelerator="ort")text = "Each step of the cell cycle is monitored by internal."response = pipe(text, max_new_tokens=64, do_sample=False)response
12345678910111213141516171819202122232425262728{ "architectures": [ "LlamaForCausalLM" ], "attention_bias": false, "attention_dropout": 0.0, "bos_token_id": 1, "eos_token_id": 2, "hidden_act": "gelu", "hidden_size": 768, "initializer_range": 0.02, "intermediate_size": 4096, "max_position_embeddings": 2048, "mlp_bias": false, "model_type": "llama", "num_attention_heads": 24, "num_hidden_layers": 6, "num_key_value_heads": 8, "pretraining_tp": 1, "rms_norm_eps": 1e-06, "rope_scaling": null, "rope_theta": 10000.0, "tie_word_embeddings": true, "torch_dtype": "float32", "transformers_version": "4.42.4", "use_cache": true, "vocab_size": 16000}123456{ "_from_model_config": true, "bos_token_id": 1, "eos_token_id": 2, "transformers_version": "4.42.4"}123version https://git-lfs.github.com/spec/v1oid sha256:94ee24624f73c64cd22a0de31d7cb086e0eec99a98e1c7bd193e7ef77001cbffsize 3134392801{'train_runtime': 12543.7806, 'train_samples_per_second': 1279.948, 'train_steps_per_second': 2.5, 'train_loss': 1.2199503767455795, 'epoch': 1.0}1234567891011121314151617181920212223{ "bos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|im_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "pad_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}12345678910111213141516171819202122232425262728293031323334353637{ "added_tokens_decoder": { "0": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "<|im_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "<|im_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "bos_token": "<|endoftext|>", "chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}", "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "errors": "replace", "model_max_length": 4096, "pad_token": "<|endoftext|>", "split_special_tokens": false, "tokenizer_class": "PreTrainedTokenizerFast"}README.md+11-10
README_zh-CN.md+11-10
config.jsonAdded+28
generation_config.jsonAdded+6
model.safetensorsAdded+3
result.logAdded+1
special_tokens_map.jsonAdded+23
tokenizer.jsonAdded
tokenizer_config.jsonAdded+37
trainer_state.jsonAdded