Text Generation
Transformers
Safetensors
neuronspark
snn
causal-lm
pretrain
deepspeed
checkpoint
conversational
custom_code
Instructions to use Brain2nd/NeuronSpark-V4-1.16B-Pretrain with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Brain2nd/NeuronSpark-V4-1.16B-Pretrain with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Brain2nd/NeuronSpark-V4-1.16B-Pretrain", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Brain2nd/NeuronSpark-V4-1.16B-Pretrain", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Brain2nd/NeuronSpark-V4-1.16B-Pretrain with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Brain2nd/NeuronSpark-V4-1.16B-Pretrain" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Brain2nd/NeuronSpark-V4-1.16B-Pretrain", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Brain2nd/NeuronSpark-V4-1.16B-Pretrain
- SGLang
How to use Brain2nd/NeuronSpark-V4-1.16B-Pretrain 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 "Brain2nd/NeuronSpark-V4-1.16B-Pretrain" \ --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": "Brain2nd/NeuronSpark-V4-1.16B-Pretrain", "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 "Brain2nd/NeuronSpark-V4-1.16B-Pretrain" \ --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": "Brain2nd/NeuronSpark-V4-1.16B-Pretrain", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Brain2nd/NeuronSpark-V4-1.16B-Pretrain with Docker Model Runner:
docker model run hf.co/Brain2nd/NeuronSpark-V4-1.16B-Pretrain
Fix pretrain EOS ids
Browse files- config.json +3 -2
- generation_config.json +3 -2
config.json
CHANGED
|
@@ -15,15 +15,16 @@
|
|
| 15 |
},
|
| 16 |
"bias_balancing_ema": 0.99,
|
| 17 |
"bias_balancing_lr": 0.001,
|
| 18 |
-
"bos_token_id":
|
| 19 |
"dtype": "bfloat16",
|
| 20 |
-
"eos_token_id":
|
| 21 |
"eps_explore": 0.05,
|
| 22 |
"k_predictor_hidden": 256,
|
| 23 |
"memory_layer_interval": 4,
|
| 24 |
"model_type": "neuronspark",
|
| 25 |
"num_hidden_layers": 24,
|
| 26 |
"num_layers": 24,
|
|
|
|
| 27 |
"ponder_T_final": 0.3,
|
| 28 |
"ponder_T_init": 2.0,
|
| 29 |
"rope_layout": "transformer_interleaved",
|
|
|
|
| 15 |
},
|
| 16 |
"bias_balancing_ema": 0.99,
|
| 17 |
"bias_balancing_lr": 0.001,
|
| 18 |
+
"bos_token_id": null,
|
| 19 |
"dtype": "bfloat16",
|
| 20 |
+
"eos_token_id": 128361,
|
| 21 |
"eps_explore": 0.05,
|
| 22 |
"k_predictor_hidden": 256,
|
| 23 |
"memory_layer_interval": 4,
|
| 24 |
"model_type": "neuronspark",
|
| 25 |
"num_hidden_layers": 24,
|
| 26 |
"num_layers": 24,
|
| 27 |
+
"pad_token_id": 128361,
|
| 28 |
"ponder_T_final": 0.3,
|
| 29 |
"ponder_T_init": 2.0,
|
| 30 |
"rope_layout": "transformer_interleaved",
|
generation_config.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
-
"bos_token_id":
|
| 4 |
-
"eos_token_id":
|
| 5 |
"output_attentions": false,
|
| 6 |
"output_hidden_states": false,
|
|
|
|
| 7 |
"transformers_version": "5.6.2",
|
| 8 |
"use_cache": false
|
| 9 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": null,
|
| 4 |
+
"eos_token_id": 128361,
|
| 5 |
"output_attentions": false,
|
| 6 |
"output_hidden_states": false,
|
| 7 |
+
"pad_token_id": 128361,
|
| 8 |
"transformers_version": "5.6.2",
|
| 9 |
"use_cache": false
|
| 10 |
}
|