| library_name: transformers | |
| license: apache-2.0 | |
| language: | |
| - en | |
| - bn | |
| - hi | |
| - kn | |
| - gu | |
| - mr | |
| - ml | |
| - or | |
| - pa | |
| - ta | |
| - te | |
| base_model: sarvamai/sarvam-m | |
| base_model_relation: finetune | |
| tags: | |
| - mlx | |
| # tvpavan/sarvam-m-mlx-2Bit | |
| The Model [tvpavan/sarvam-m-mlx-2Bit](https://huggingface.co/tvpavan/sarvam-m-mlx-2Bit) was converted to MLX format from [sarvamai/sarvam-m](https://huggingface.co/sarvamai/sarvam-m) using mlx-lm version **0.22.3**. | |
| ## Use with mlx | |
| ```bash | |
| pip install mlx-lm | |
| ``` | |
| ```python | |
| from mlx_lm import load, generate | |
| model, tokenizer = load("tvpavan/sarvam-m-mlx-2Bit") | |
| prompt="hello" | |
| if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None: | |
| messages = [{"role": "user", "content": prompt}] | |
| prompt = tokenizer.apply_chat_template( | |
| messages, tokenize=False, add_generation_prompt=True | |
| ) | |
| response = generate(model, tokenizer, prompt=prompt, verbose=True) | |
| ``` | |