Instructions to use cnfusion/Open-RS3-mlx-4Bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use cnfusion/Open-RS3-mlx-4Bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("cnfusion/Open-RS3-mlx-4Bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- MLX LM
How to use cnfusion/Open-RS3-mlx-4Bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "cnfusion/Open-RS3-mlx-4Bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "cnfusion/Open-RS3-mlx-4Bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cnfusion/Open-RS3-mlx-4Bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
Upload config.json with huggingface_hub
Browse files- config.json +37 -0
config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 151643,
|
| 7 |
+
"eos_token_id": 151643,
|
| 8 |
+
"hidden_act": "silu",
|
| 9 |
+
"hidden_size": 1536,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 8960,
|
| 12 |
+
"max_position_embeddings": 131072,
|
| 13 |
+
"max_window_layers": 21,
|
| 14 |
+
"model_type": "qwen2",
|
| 15 |
+
"num_attention_heads": 12,
|
| 16 |
+
"num_hidden_layers": 28,
|
| 17 |
+
"num_key_value_heads": 2,
|
| 18 |
+
"quantization": {
|
| 19 |
+
"group_size": 64,
|
| 20 |
+
"bits": 4
|
| 21 |
+
},
|
| 22 |
+
"quantization_config": {
|
| 23 |
+
"group_size": 64,
|
| 24 |
+
"bits": 4
|
| 25 |
+
},
|
| 26 |
+
"rms_norm_eps": 1e-06,
|
| 27 |
+
"rope_scaling": null,
|
| 28 |
+
"rope_theta": 10000,
|
| 29 |
+
"sliding_window": 4096,
|
| 30 |
+
"tie_word_embeddings": false,
|
| 31 |
+
"torch_dtype": "bfloat16",
|
| 32 |
+
"transformers_version": "4.49.0",
|
| 33 |
+
"use_cache": false,
|
| 34 |
+
"use_mrope": false,
|
| 35 |
+
"use_sliding_window": false,
|
| 36 |
+
"vocab_size": 151936
|
| 37 |
+
}
|