Text Generation
Transformers
Safetensors
cohere2_moe
conversational
chat
code
agent
compressed-tensors
Instructions to use cyankiwi/North-Mini-Code-1.0-AWQ-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cyankiwi/North-Mini-Code-1.0-AWQ-INT4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cyankiwi/North-Mini-Code-1.0-AWQ-INT4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cyankiwi/North-Mini-Code-1.0-AWQ-INT4") model = AutoModelForCausalLM.from_pretrained("cyankiwi/North-Mini-Code-1.0-AWQ-INT4", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cyankiwi/North-Mini-Code-1.0-AWQ-INT4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyankiwi/North-Mini-Code-1.0-AWQ-INT4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cyankiwi/North-Mini-Code-1.0-AWQ-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cyankiwi/North-Mini-Code-1.0-AWQ-INT4
- SGLang
How to use cyankiwi/North-Mini-Code-1.0-AWQ-INT4 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 "cyankiwi/North-Mini-Code-1.0-AWQ-INT4" \ --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": "cyankiwi/North-Mini-Code-1.0-AWQ-INT4", "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 "cyankiwi/North-Mini-Code-1.0-AWQ-INT4" \ --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": "cyankiwi/North-Mini-Code-1.0-AWQ-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cyankiwi/North-Mini-Code-1.0-AWQ-INT4 with Docker Model Runner:
docker model run hf.co/cyankiwi/North-Mini-Code-1.0-AWQ-INT4
"Only symmetric quantization is supported for MoE"
#1
by ydawei - opened
Got this error, on vLLM 0.22.1:
EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/models/cohere2_moe.py", line 562, in __init__
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] self.model = Cohere2MoeModel(
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/compilation/decorators.py", line 383, in __init__
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] old_init(self, *args, **kwargs)
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/models/cohere2_moe.py", line 402, in __init__
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] self.start_layer, self.end_layer, self.layers = make_layers(
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/models/utils.py", line 643, in make_layers
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] + get_offloader().wrap_modules(
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/offloader/base.py", line 104, in wrap_modules
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] return list(modules_generator)
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/models/utils.py", line 644, in <genexpr>
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] layer_fn(prefix=f"{prefix}.{idx}") for idx in range(start_layer, end_layer)
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/models/cohere2_moe.py", line 404, in <lambda>
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] lambda prefix: Cohere2MoeDecoderLayer(
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/models/cohere2_moe.py", line 359, in __init__
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] self.mlp = Cohere2Moe(
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/models/cohere2_moe.py", line 300, in __init__
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] self.experts = FusedMoE(
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/layers/fused_moe/layer.py", line 368, in __init__
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] self.quant_method: FusedMoEMethodBase = _get_quant_method()
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/layers/fused_moe/layer.py", line 360, in _get_quant_method
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] quant_method = self.quant_config.get_quant_method(self, prefix)
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py", line 184, in get_quant_method
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] return CompressedTensorsMoEMethod.get_moe_method(
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe/compressed_tensors_moe.py", line 114, in get_moe_method
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] return CompressedTensorsWNA16MoEMethod(
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] File "/usr/local/lib/python3.12/dist-packages/vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe/compressed_tensors_moe_wna16.py", line 50, in __init__
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] assert weight_quant.symmetric, (
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] ^^^^^^^^^^^^^^^^^^^^^^
(EngineCore pid=83) ERROR 06-11 06:46:38 [core.py:1165] AssertionError: Only symmetric quantization is supported for MoE