Text Generation
Transformers
Safetensors
English
Japanese
plamo2
plamo
translation
conversational
custom_code
Instructions to use mlx-community/plamo-2-translate-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlx-community/plamo-2-translate-bf16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlx-community/plamo-2-translate-bf16", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("mlx-community/plamo-2-translate-bf16", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mlx-community/plamo-2-translate-bf16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlx-community/plamo-2-translate-bf16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/plamo-2-translate-bf16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mlx-community/plamo-2-translate-bf16
- SGLang
How to use mlx-community/plamo-2-translate-bf16 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 "mlx-community/plamo-2-translate-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/plamo-2-translate-bf16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "mlx-community/plamo-2-translate-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/plamo-2-translate-bf16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mlx-community/plamo-2-translate-bf16 with Docker Model Runner:
docker model run hf.co/mlx-community/plamo-2-translate-bf16
| { | |
| "architectures": [ | |
| "Plamo2ForCausalLM" | |
| ], | |
| "attention_window_size": 32768, | |
| "auto_map": { | |
| "AutoConfig": "modeling_plamo.Plamo2Config", | |
| "AutoModelForCausalLM": "modeling_plamo.Plamo2ForCausalLM" | |
| }, | |
| "bos_token_id": 1, | |
| "eos_token_id": 1, | |
| "eval_attention_n_bit": null, | |
| "eval_mlp_n_bit": null, | |
| "fp8_accum_dtype": "bfloat16", | |
| "full_attention_idx": [], | |
| "hidden_size": 4096, | |
| "hidden_size_per_head": 128, | |
| "image_feature_size": null, | |
| "image_proj_type": "linear", | |
| "image_token_id": null, | |
| "intermediate_size": 16384, | |
| "linear_type": "normal", | |
| "mamba_chunk_size": 256, | |
| "mamba_d_conv": 4, | |
| "mamba_d_state": 64, | |
| "mamba_enabled": true, | |
| "mamba_num_heads": 64, | |
| "mamba_step": 2, | |
| "max_position_embeddings": 10485760, | |
| "model_type": "plamo2", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 32, | |
| "num_key_value_heads": 4, | |
| "pad_token_id": 3, | |
| "rms_norm_eps": 1e-06, | |
| "rope_local_theta": 1000000.0, | |
| "rope_theta": 1000000.0, | |
| "sliding_window": 32768, | |
| "tie_word_embeddings": false, | |
| "tokenizer_class": "Plamo2Tokenizer", | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.46.2", | |
| "use_cache": false, | |
| "vocab_size": 100032 | |
| } |