Instructions to use mlx-community/Llama-2-7b-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Llama-2-7b-mlx with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/Llama-2-7b-mlx") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use mlx-community/Llama-2-7b-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "mlx-community/Llama-2-7b-mlx" --prompt "Once upon a time"
params.json -> config.json, add model_type
Browse files- config.json +9 -0
- params.json +0 -1
config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dim": 4096,
|
| 3 |
+
"multiple_of": 256,
|
| 4 |
+
"n_heads": 32,
|
| 5 |
+
"n_layers": 32,
|
| 6 |
+
"norm_eps": 1e-05,
|
| 7 |
+
"vocab_size": -1,
|
| 8 |
+
"model_type": "llama"
|
| 9 |
+
}
|
params.json
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"dim": 4096, "multiple_of": 256, "n_heads": 32, "n_layers": 32, "norm_eps": 1e-05, "vocab_size": -1}
|
|
|
|
|
|