Commit ·
e39d4c3
verified ·
0
Parent(s):
Duplicate from nvidia/DeepSeek-R1-0528-FP4
Browse filesCo-authored-by: Omri Almog <omrialmog@users.noreply.huggingface.co>
This view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributesAdded+37
- LICENSEAdded+9
- README.mdAdded+231
- config.jsonAdded+58
- configuration_deepseek.pyAdded+238
- generation_config.jsonAdded+9
- hf_quant_config.jsonAdded+78
- model-00001-of-000163.safetensorsAdded+3
- model-00002-of-000163.safetensorsAdded+3
- model-00003-of-000163.safetensorsAdded+3
- model-00004-of-000163.safetensorsAdded+3
- model-00005-of-000163.safetensorsAdded+3
- model-00006-of-000163.safetensorsAdded+3
- model-00007-of-000163.safetensorsAdded+3
- model-00008-of-000163.safetensorsAdded+3
- model-00009-of-000163.safetensorsAdded+3
- model-00010-of-000163.safetensorsAdded+3
- model-00011-of-000163.safetensorsAdded+3
- model-00012-of-000163.safetensorsAdded+3
- model-00013-of-000163.safetensorsAdded+3
- model-00014-of-000163.safetensorsAdded+3
- model-00015-of-000163.safetensorsAdded+3
- model-00016-of-000163.safetensorsAdded+3
- model-00017-of-000163.safetensorsAdded+3
- model-00018-of-000163.safetensorsAdded+3
- model-00019-of-000163.safetensorsAdded+3
- model-00020-of-000163.safetensorsAdded+3
- model-00021-of-000163.safetensorsAdded+3
- model-00022-of-000163.safetensorsAdded+3
- model-00023-of-000163.safetensorsAdded+3
- model-00024-of-000163.safetensorsAdded+3
- model-00025-of-000163.safetensorsAdded+3
- model-00026-of-000163.safetensorsAdded+3
- model-00027-of-000163.safetensorsAdded+3
- model-00028-of-000163.safetensorsAdded+3
- model-00029-of-000163.safetensorsAdded+3
- model-00030-of-000163.safetensorsAdded+3
- model-00031-of-000163.safetensorsAdded+3
- model-00032-of-000163.safetensorsAdded+3
- model-00033-of-000163.safetensorsAdded+3
- model-00034-of-000163.safetensorsAdded+3
- model-00035-of-000163.safetensorsAdded+3
- model-00036-of-000163.safetensorsAdded+3
- model-00037-of-000163.safetensorsAdded+3
- model-00038-of-000163.safetensorsAdded+3
- model-00039-of-000163.safetensorsAdded+3
- model-00040-of-000163.safetensorsAdded+3
- model-00041-of-000163.safetensorsAdded+3
- model-00042-of-000163.safetensorsAdded+3
- model-00043-of-000163.safetensorsAdded+3
12345678910111213141516171819202122232425262728293031323334353637*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textmodel.safetensors.index.json filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text123456789MIT License
Copyright (c) 2025 Nvidia
Copyright (c) 2023 DeepSeek
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231---pipeline_tag: text-generationbase_model:- deepseek-ai/DeepSeek-R1-0528license: mitlibrary_name: Model Optimizertags:- nvidia- ModelOpt- DeepSeekR1- quantized- FP4---# Model Overview
## Description:The NVIDIA DeepSeek-R1-0528-FP4 model is the quantized version of the DeepSeek AI's DeepSeek R1 0528 model, which is an auto-regressive language model that uses an optimized transformer architecture. For more information, please check [here](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528). The NVIDIA DeepSeek R1 FP4 model is quantized with [TensorRT Model Optimizer](https://github.com/NVIDIA/TensorRT-Model-Optimizer).
This model is ready for commercial/non-commercial use. <br>
## Third-Party Community ConsiderationThis model is not owned or developed by NVIDIA. This model has been developed and built to a third-party’s requirements for this application and use case; see link to Non-NVIDIA [(DeepSeek R1) Model Card](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528).
### License/Terms of Use:[MIT](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/mit.md)
## Model Architecture:**Architecture Type:** Transformers <br>**Network Architecture:** DeepSeek R1 <br>
## Input:**Input Type(s):** Text <br>**Input Format(s):** String <br>**Input Parameters:** 1D (One Dimensional): Sequences <br>**Other Properties Related to Input:** DeepSeek recommends adhering to the following configurations when utilizing the DeepSeek-R1 series models, including benchmarking, to achieve the expected performance: \
- Set the temperature within the range of 0.5-0.7 (0.6 is recommended) to prevent endless repetitions or incoherent outputs.- Avoid adding a system prompt; all instructions should be contained within the user prompt.- For mathematical problems, it is advisable to include a directive in your prompt such as: "Please reason step by step, and put your final answer within \boxed{}."- When evaluating model performance, it is recommended to conduct multiple tests and average the results. <br>
## Output:**Output Type(s):** Text <br>**Output Format:** String <br>**Output Parameters:** 1D (One Dimensional): Sequences <br>
## Software Integration:**Supported Runtime Engine(s):** <br>* TensorRT-LLM <br>
**Supported Hardware Microarchitecture Compatibility:** <br>* NVIDIA Blackwell <br>
**Preferred Operating System(s):** <br>* Linux <br>
## Model Version(s):** The model is quantized with nvidia-modelopt **v0.31.0** <br>
## Training Dataset: <br>** Data Collection Method by dataset: Hybrid: Human, Automated <br>** Labeling Method by dataset: Hybrid: Human, Automated <br>
## Testing Dataset: <br>** Data Collection Method by dataset: Hybrid: Human, Automated <br>** Labeling Method by dataset: Hybrid: Human, Automated <br>
## Evaluation Dataset: <br>** Data Collection Method by dataset: Hybrid: Human, Automated <br>** Labeling Method by dataset: Hybrid: Human, Automated <br>
## Calibration Datasets:* Calibration Dataset: [cnn_dailymail](https://huggingface.co/datasets/abisee/cnn_dailymail) <br>** Data collection method: Automated. <br>** Labeling method: Undisclosed. <br>
## Inference:**Engine:** TensorRT-LLM <br>**Test Hardware:** B200 <br>
## Post Training QuantizationThis model was obtained by quantizing the weights and activations of DeepSeek R1 to FP4 data type, ready for inference with TensorRT-LLM. Only the weights and activations of the linear operators within transformer blocks are quantized. This optimization reduces the number of bits per parameter from 8 to 4, reducing the disk size and GPU memory requirements by approximately 1.6x.
## Usage
### Deploy with TensorRT-LLM
To deploy the quantized FP4 checkpoint with [TensorRT-LLM](https://github.com/NVIDIA/TensorRT-LLM) LLM API, follow the sample codes below (you need 8xB200 GPU and TensorRT LLM built from source with the latest main branch):
#### LLM API sample usage:```from tensorrt_llm import SamplingParamsfrom tensorrt_llm._torch import LLM
def main():
prompts = [ "Hello, my name is", "The president of the United States is", "The capital of France is", "The future of AI is", ] sampling_params = SamplingParams(max_tokens=32)
llm = LLM(model="nvidia/DeepSeek-R1-0528-FP4", tensor_parallel_size=8, enable_attention_dp=True)
outputs = llm.generate(prompts, sampling_params)
# Print the outputs. for output in outputs: prompt = output.prompt generated_text = output.outputs[0].text print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
# The entry point of the program need to be protected for spawning processes.if __name__ == '__main__': main()
```
#### Minimum Latency Server Deployment
If you want to deploy your endpoint to minimize response latency for a single-concurrency or low-concurrency use case, follow the instructions below.
**Step 1: Create configuration file (`args.yaml`)**
```yamlmoe_backend: TRTLLMuse_cuda_graph: truespeculative_config: decoding_type: MTP num_nextn_predict_layers: 3 use_relaxed_acceptance_for_thinking: true relaxed_topk: 10 relaxed_delta: 0.6```
**Step 2: Start the TensorRT-LLM server**
```bashtrtllm-serve nvidia/DeepSeek-R1-0528-FP4 \ --host 0.0.0.0 \ --port 8000 \ --backend pytorch \ --max_batch_size 4 \ --tp_size 8 \ --ep_size 2 \ --max_num_tokens 32768 \ --trust_remote_code \ --extra_llm_api_options args.yaml \ --kv_cache_free_gpu_memory_fraction 0.75```
**Step 3: Send an example query**
```bashcurl localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "nvidia/DeepSeek-R1-0528-FP4", "messages": [{"role": "user", "content": "Why is NVIDIA a great company?"}], "max_tokens": 1024 }'```
### EvaluationThe accuracy benchmark results are presented in the table below:<table> <tr> <td><strong>Precision</strong> </td> <td><strong>MMLU Pro</strong> </td> <td><strong>GPQA Diamond</strong> </td> <td><strong>LiveCodeBench</strong> </td> <td><strong>SCICODE</strong> </td> <td><strong>MATH-500</strong> </td> <td><strong>AIME 2024</strong> </td> </tr> <tr> <td>FP8 (AA Ref) </td> <td>85 </td> <td>81 </td> <td>77 </td> <td>40 </td> <td>98 </td> <td>89 </td> </tr> <tr> <td>FP4 </td> <td>84.2 </td> <td>80.0 </td> <td>76.3 </td> <td>40.1 </td> <td>98.1 </td> <td>91.3 </td> </tr> <tr></table>
## Model Limitations:The base model was trained on data that contains toxic language and societal biases originally crawled from the internet. Therefore, the model may amplify those biases and return toxic responses especially when prompted with toxic prompts. The model may generate answers that may be inaccurate, omit key information, or include irrelevant or redundant text producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive.
## Ethical Considerations
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758{ "architectures": [ "DeepseekV3ForCausalLM" ], "attention_bias": false, "attention_dropout": 0.0, "auto_map": { "AutoConfig": "configuration_deepseek.DeepseekV3Config", "AutoModel": "modeling_deepseek.DeepseekV3Model", "AutoModelForCausalLM": "modeling_deepseek.DeepseekV3ForCausalLM" }, "bos_token_id": 0, "eos_token_id": 1, "ep_size": 1, "first_k_dense_replace": 3, "hidden_act": "silu", "hidden_size": 7168, "initializer_range": 0.02, "intermediate_size": 18432, "kv_lora_rank": 512, "max_position_embeddings": 163840, "model_type": "deepseek_v3", "moe_intermediate_size": 2048, "moe_layer_freq": 1, "n_group": 8, "n_routed_experts": 256, "n_shared_experts": 1, "norm_topk_prob": true, "num_attention_heads": 128, "num_experts_per_tok": 8, "num_hidden_layers": 61, "num_key_value_heads": 128, "num_nextn_predict_layers": 1, "q_lora_rank": 1536, "qk_nope_head_dim": 128, "qk_rope_head_dim": 64, "rms_norm_eps": 1e-06, "rope_scaling": { "beta_fast": 32, "beta_slow": 1, "factor": 40, "mscale": 1.0, "mscale_all_dim": 1.0, "original_max_position_embeddings": 4096, "type": "yarn" }, "rope_theta": 10000, "routed_scaling_factor": 2.5, "scoring_func": "sigmoid", "tie_word_embeddings": false, "topk_group": 4, "topk_method": "noaux_tc", "torch_dtype": "bfloat16", "transformers_version": "4.46.3", "use_cache": true, "v_head_dim": 128, "vocab_size": 129280}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238# Adapted from https://huggingface.co/deepseek-ai/DeepSeek-R1-0528/blob/main/configuration_deepseek.py# MIT License
# Copyright (c) 2023 DeepSeek
# Permission is hereby granted, free of charge, to any person obtaining a copy# of this software and associated documentation files (the "Software"), to deal# in the Software without restriction, including without limitation the rights# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell# copies of the Software, and to permit persons to whom the Software is# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE# SOFTWARE.
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.# SPDX-License-Identifier: Apache-2.0## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.
from transformers.configuration_utils import PretrainedConfigfrom transformers.utils import logging
logger = logging.get_logger(__name__)
DEEPSEEK_PRETRAINED_CONFIG_ARCHIVE_MAP = {}class DeepseekV3Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`DeepseekV3Model`]. It is used to instantiate an DeepSeek model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the DeepSeek-V3.
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the documentation from [`PretrainedConfig`] for more information.
Args: vocab_size (`int`, *optional*, defaults to 129280): Vocabulary size of the Deep model. Defines the number of different tokens that can be represented by the `inputs_ids` passed when calling [`DeepseekV3Model`] hidden_size (`int`, *optional*, defaults to 4096): Dimension of the hidden representations. intermediate_size (`int`, *optional*, defaults to 11008): Dimension of the MLP representations. moe_intermediate_size (`int`, *optional*, defaults to 1407): Dimension of the MoE representations. num_hidden_layers (`int`, *optional*, defaults to 32): Number of hidden layers in the Transformer decoder. num_nextn_predict_layers (`int`, *optional*, defaults to 1): Number of nextn predict layers in the DeepSeekV3 Model. num_attention_heads (`int`, *optional*, defaults to 32): Number of attention heads for each attention layer in the Transformer decoder. n_shared_experts (`int`, *optional*, defaults to None): Number of shared experts, None means dense model. n_routed_experts (`int`, *optional*, defaults to None): Number of routed experts, None means dense model. routed_scaling_factor (`float`, *optional*, defaults to 1.0): Scaling factor or routed experts. topk_method (`str`, *optional*, defaults to `gready`): Topk method used in routed gate. n_group (`int`, *optional*, defaults to None): Number of groups for routed experts. topk_group (`int`, *optional*, defaults to None): Number of selected groups for each token(for each token, ensuring the selected experts is only within `topk_group` groups). num_experts_per_tok (`int`, *optional*, defaults to None): Number of selected experts, None means dense model. moe_layer_freq (`int`, *optional*, defaults to 1): The frequency of the MoE layer: one expert layer for every `moe_layer_freq - 1` dense layers. first_k_dense_replace (`int`, *optional*, defaults to 0): Number of dense layers in shallow layers(embed->dense->dense->...->dense->moe->moe...->lm_head). \--k dense layers--/ norm_topk_prob (`bool`, *optional*, defaults to False): Whether to normalize the weights of the routed experts. scoring_func (`str`, *optional*, defaults to 'softmax'): Method of computing expert weights. aux_loss_alpha (`float`, *optional*, defaults to 0.001): Auxiliary loss weight coefficient. seq_aux = (`bool`, *optional*, defaults to True): Whether to compute the auxiliary loss for each individual sample. num_key_value_heads (`int`, *optional*): This is the number of key_value heads that should be used to implement Grouped Query Attention. If `num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if `num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed by meanpooling all the original heads within that group. For more details checkout [this paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to `num_attention_heads`. hidden_act (`str` or `function`, *optional*, defaults to `"silu"`): The non-linear activation function (function or string) in the decoder. max_position_embeddings (`int`, *optional*, defaults to 2048): The maximum sequence length that this model might ever be used with. initializer_range (`float`, *optional*, defaults to 0.02): The standard deviation of the truncated_normal_initializer for initializing all weight matrices. rms_norm_eps (`float`, *optional*, defaults to 1e-06): The epsilon used by the rms normalization layers. use_cache (`bool`, *optional*, defaults to `True`): Whether or not the model should return the last key/values attentions (not used by all models). Only relevant if `config.is_decoder=True`. pad_token_id (`int`, *optional*): Padding token id. bos_token_id (`int`, *optional*, defaults to 1): Beginning of stream token id. eos_token_id (`int`, *optional*, defaults to 2): End of stream token id. tie_word_embeddings (`bool`, *optional*, defaults to `False`): Whether to tie weight embeddings rope_theta (`float`, *optional*, defaults to 10000.0): The base period of the RoPE embeddings. rope_scaling (`Dict`, *optional*): Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is `{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update `max_position_embeddings` to the expected new maximum. attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`): Whether to use a bias in the query, key, value and output projection layers during self-attention. attention_dropout (`float`, *optional*, defaults to 0.0): The dropout ratio for the attention probabilities.
```python >>> from transformers import DeepseekV3Model, DeepseekV3Config
>>> # Initializing a Deepseek-V3 style configuration >>> configuration = DeepseekV3Config()
>>> # Accessing the model configuration >>> configuration = model.config ```"""
model_type = "deepseek_v3" keys_to_ignore_at_inference = ["past_key_values"]
def __init__( self, vocab_size=129280, hidden_size=7168, intermediate_size=18432, moe_intermediate_size = 2048, num_hidden_layers=61, num_nextn_predict_layers=1, num_attention_heads=128, num_key_value_heads=128, n_shared_experts = 1, n_routed_experts = 256, ep_size = 1, routed_scaling_factor = 2.5, kv_lora_rank = 512, q_lora_rank = 1536, qk_rope_head_dim = 64, v_head_dim = 128, qk_nope_head_dim = 128, topk_method = 'noaux_tc', n_group = 8, topk_group = 4, num_experts_per_tok = 8, moe_layer_freq = 1, first_k_dense_replace = 3, norm_topk_prob = True, scoring_func = 'sigmoid', hidden_act="silu", max_position_embeddings=4096, initializer_range=0.02, rms_norm_eps=1e-6, use_cache=True, pad_token_id=None, bos_token_id=0, eos_token_id=1, tie_word_embeddings=False, rope_theta=10000.0, rope_scaling=None, attention_bias=False, attention_dropout=0.0, **kwargs, ): self.vocab_size = vocab_size self.max_position_embeddings = max_position_embeddings self.hidden_size = hidden_size self.intermediate_size = intermediate_size self.moe_intermediate_size = moe_intermediate_size self.num_hidden_layers = num_hidden_layers self.num_nextn_predict_layers = num_nextn_predict_layers self.num_attention_heads = num_attention_heads self.n_shared_experts = n_shared_experts self.n_routed_experts = n_routed_experts self.ep_size = ep_size self.routed_scaling_factor = routed_scaling_factor self.kv_lora_rank = kv_lora_rank self.q_lora_rank = q_lora_rank self.qk_rope_head_dim = qk_rope_head_dim self.v_head_dim = v_head_dim self.qk_nope_head_dim = qk_nope_head_dim self.topk_method = topk_method self.n_group = n_group self.topk_group = topk_group self.num_experts_per_tok = num_experts_per_tok self.moe_layer_freq = moe_layer_freq self.first_k_dense_replace = first_k_dense_replace self.norm_topk_prob = norm_topk_prob self.scoring_func = scoring_func # for backward compatibility if num_key_value_heads is None: num_key_value_heads = num_attention_heads
self.num_key_value_heads = num_key_value_heads self.hidden_act = hidden_act self.initializer_range = initializer_range self.rms_norm_eps = rms_norm_eps self.use_cache = use_cache self.rope_theta = rope_theta self.rope_scaling = rope_scaling self.attention_bias = attention_bias self.attention_dropout = attention_dropout
super().__init__( pad_token_id=pad_token_id, bos_token_id=bos_token_id, eos_token_id=eos_token_id, tie_word_embeddings=tie_word_embeddings, **kwargs, )123456789{ "_from_model_config": true, "bos_token_id": 0, "eos_token_id": 1, "do_sample": true, "temperature": 0.6, "top_p": 0.95, "transformers_version": "4.46.3"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778{ "producer": { "name": "modelopt", "version": "0.31.0" }, "quantization": { "quant_algo": "NVFP4", "kv_cache_quant_algo": "FP8", "group_size": 16, "has_zero_point": false, "pre_quant_scale": true, "exclude_modules": [ "lm_head", "model.layers.0.self_attn*", "model.layers.1.self_attn*", "model.layers.10.self_attn*", "model.layers.11.self_attn*", "model.layers.12.self_attn*", "model.layers.13.self_attn*", "model.layers.14.self_attn*", "model.layers.15.self_attn*", "model.layers.16.self_attn*", "model.layers.17.self_attn*", "model.layers.18.self_attn*", "model.layers.19.self_attn*", "model.layers.2.self_attn*", "model.layers.20.self_attn*", "model.layers.21.self_attn*", "model.layers.22.self_attn*", "model.layers.23.self_attn*", "model.layers.24.self_attn*", "model.layers.25.self_attn*", "model.layers.26.self_attn*", "model.layers.27.self_attn*", "model.layers.28.self_attn*", "model.layers.29.self_attn*", "model.layers.3.self_attn*", "model.layers.30.self_attn*", "model.layers.31.self_attn*", "model.layers.32.self_attn*", "model.layers.33.self_attn*", "model.layers.34.self_attn*", "model.layers.35.self_attn*", "model.layers.36.self_attn*", "model.layers.37.self_attn*", "model.layers.38.self_attn*", "model.layers.39.self_attn*", "model.layers.4.self_attn*", "model.layers.40.self_attn*", "model.layers.41.self_attn*", "model.layers.42.self_attn*", "model.layers.43.self_attn*", "model.layers.44.self_attn*", "model.layers.45.self_attn*", "model.layers.46.self_attn*", "model.layers.47.self_attn*", "model.layers.48.self_attn*", "model.layers.49.self_attn*", "model.layers.5.self_attn*", "model.layers.50.self_attn*", "model.layers.51.self_attn*", "model.layers.52.self_attn*", "model.layers.53.self_attn*", "model.layers.54.self_attn*", "model.layers.55.self_attn*", "model.layers.56.self_attn*", "model.layers.57.self_attn*", "model.layers.58.self_attn*", "model.layers.59.self_attn*", "model.layers.6.self_attn*", "model.layers.60.self_attn*", "model.layers.7.self_attn*", "model.layers.8.self_attn*", "model.layers.9.self_attn*", "model.layers.61*" ] }}123version https://git-lfs.github.com/spec/v1oid sha256:bbf04b49f4cdb3c2cb139d84e9701089cff14d08b95b969379aa5b57a63a9242size 4832128352123version https://git-lfs.github.com/spec/v1oid sha256:ac6cb6c4a30d18ee8d24c5237c1b0f9cb30ab24aa9f4e4758a8beb5125360720size 2419597576123version https://git-lfs.github.com/spec/v1oid sha256:c280f0fc3241c685b033c26c92fd4c3fca34285f288922e3d8119ba7d779aa32size 2419598384123version https://git-lfs.github.com/spec/v1oid sha256:ca5f80f8d62248366271495d0a9a95953dd5fb06237231a3f8465207d475edd9size 2690159456123version https://git-lfs.github.com/spec/v1oid sha256:5a454d4577381ec2fb9511015c9a06024fe592949badd45d36d2efe24dc1a0f2size 2419597944123version https://git-lfs.github.com/spec/v1oid sha256:9bb8873103ba89dd16efad52e7846abe7a0ee40af47d4739f3503a82160b1001size 2727779136123version https://git-lfs.github.com/spec/v1oid sha256:48a5a4d26db3e4a11d1bacdfd5c94e27bfc90b14750c165ee7ebca2d81b924e4size 2423268408123version https://git-lfs.github.com/spec/v1oid sha256:b52d09d1147f1704bb39096221afbd992c6a1fe1114358975ddca79ea214361esize 2419598352123version https://git-lfs.github.com/spec/v1oid sha256:0f0274233de53fe22c50262c36d6154579af3cc29b83d3b2d601761b0475c810size 2690159840123version https://git-lfs.github.com/spec/v1oid sha256:2658cef0619d4912da43964d312fa1448eac38f5e44e0313218367b888f8e7aesize 2419597560123version https://git-lfs.github.com/spec/v1oid sha256:360189a2c32647c16efbf465a9f2bb3f607e47f0848c6dbfca1eae455d8fa6ddsize 2419598384123version https://git-lfs.github.com/spec/v1oid sha256:8ae7554ea1a6d65c9e194dd99254bc0797c9fd848a7be23fca94e2defc56ce9dsize 743249736123version https://git-lfs.github.com/spec/v1oid sha256:dc6ed60abb1be1223979884405aad63f35e5eec42c28b73773bd19f834c90065size 2690130224123version https://git-lfs.github.com/spec/v1oid sha256:7d359af3e3ccf70794d83235e5d022392cb76ade1a34d4fd8797c588c212056asize 2419598296123version https://git-lfs.github.com/spec/v1oid sha256:afbdb1f5da08dc38ecaf900ae8866e4687a3ec9e2b21b16d0cba7fa3d529b74asize 2690159904123version https://git-lfs.github.com/spec/v1oid sha256:b0ed219a52ec2d617ecc750963519df23d5e27160621d2fd964b506ba017a5bcsize 2419597504123version https://git-lfs.github.com/spec/v1oid sha256:bbe5cb864267a27a55add115d27f9fdec6d47405f626de9774e0f79ed271de8esize 2419598384123version https://git-lfs.github.com/spec/v1oid sha256:ca0e49de986c19b866bf2c330ca91f8c0a092ee56e19ce832267f375174cc496size 2690159520123version https://git-lfs.github.com/spec/v1oid sha256:0b1db3ad16aea8afdcc667011dabc11addf41c20b4c10234508117578278ba21size 2419597880123version https://git-lfs.github.com/spec/v1oid sha256:c016097de09ca54826380158d531ef7121ccc6f5aa44dbbe255dd4c80e817e7dsize 2419598392123version https://git-lfs.github.com/spec/v1oid sha256:4929c6acd11fa3f87465aef13e5ce7e3d24c83a1babac6d1c99c0201bba7985bsize 2690160248123version https://git-lfs.github.com/spec/v1oid sha256:05f55fd3fa47fcebc0c4910204672fb602b30f364cf088544c6ec1d67f7d33basize 2419599440123version https://git-lfs.github.com/spec/v1oid sha256:8f861d34dfd9299c043ba0c351505bef3a107d8f95ea8a46ceda8a3ebf6f2625size 2690161056123version https://git-lfs.github.com/spec/v1oid sha256:95362bd84e97a23460933f630b69d9ff720b7d1da15c544b97ade3481bcca444size 2419598648123version https://git-lfs.github.com/spec/v1oid sha256:c1db194b1d6a0f2c6a1935e5105622174007db387c79e6c1b5430bc3273c778bsize 2419599560123version https://git-lfs.github.com/spec/v1oid sha256:d181f80f2aaf9cb7bdf68e421b950d64a583a52420ce5fd0d3b411ed33c3ea66size 2690160688123version https://git-lfs.github.com/spec/v1oid sha256:04ee66ce0f3e51f407d5a68e4b29c0b63e9bda0a5e88896c39a097aaba3a2dd2size 2419599024123version https://git-lfs.github.com/spec/v1oid sha256:9167d91670023079e629de55d02be50a06a720b125da70b9556481b9f23e49d3size 2419599560123version https://git-lfs.github.com/spec/v1oid sha256:ecf62e772486af899afb440540803550480343b66e5dc096e1e4a8dea6a44154size 2690160304123version https://git-lfs.github.com/spec/v1oid sha256:18dfa7d3ed08561b4109e83e49fe4a073ce5b1a23d374bce98dc5bab832f4948size 2419599400123version https://git-lfs.github.com/spec/v1oid sha256:70e471763de9f5ad8b12cc26be6f44d48c8ebcbb7f1c4a57f4eaabf112f7f57fsize 2690161096123version https://git-lfs.github.com/spec/v1oid sha256:fd86c19b1c61cd171d5f573cd62a85d09baae34b54b678ceed921c522412a406size 2419598608123version https://git-lfs.github.com/spec/v1oid sha256:e4a2457ca0b979830ba5bdff1b9e17be8ec227c866a8adeeb455abc87a780761size 2419599568123version https://git-lfs.github.com/spec/v1oid sha256:a69fad78c8fce390011d98b140789010e2fcb83129e7ca17ce1bce64bfd2b759size 982732544123version https://git-lfs.github.com/spec/v1oid sha256:a3898dfd91f59bec65c82ae04b707575501e32f43d2f1dfb26174912f01d0fd5size 2690131360123version https://git-lfs.github.com/spec/v1oid sha256:2e0fe82025efc32f27a290438b2e607c89ac394716e97b3c9b6cfa27e2480623size 2419599464123version https://git-lfs.github.com/spec/v1oid sha256:77afb4330256683ef7962bf43cae8762f80fb0edf889be55073f421c3ad24930size 2690161032123version https://git-lfs.github.com/spec/v1oid sha256:8e2498c311a925d54212cee7d41ce4f98c345d788adcddcc749053292511e4bdsize 2419598672123version https://git-lfs.github.com/spec/v1oid sha256:0ee6089eb7bfef59dde3b154b1e133f0034347b391b7ed3c903d6e6525b20ea9size 2419599560123version https://git-lfs.github.com/spec/v1oid sha256:54bee64d4e307768da9a6bf437e00eec91e3a4986a2358d2d5eb41d915f4dd0esize 2690160656123version https://git-lfs.github.com/spec/v1oid sha256:e8fc96ae38097b90d1b4424f7610186ff7102cfa67930823a5500906f0398b7fsize 2419599056123version https://git-lfs.github.com/spec/v1oid sha256:2adea35e960e5e35f95c62c0bc97d883248aa79d186da815535336fb0ea914c3size 2419599568123version https://git-lfs.github.com/spec/v1oid sha256:bad155fdce361b40b328edbe35e3995cf6e149e1f798eba415db58ff998880fbsize 2690160264.gitattributesAdded+37
LICENSEAdded+9
README.mdAdded+231
config.jsonAdded+58
configuration_deepseek.pyAdded+238
generation_config.jsonAdded+9
hf_quant_config.jsonAdded+78
model-00001-of-000163.safetensorsAdded+3
model-00002-of-000163.safetensorsAdded+3
model-00003-of-000163.safetensorsAdded+3
model-00004-of-000163.safetensorsAdded+3
model-00005-of-000163.safetensorsAdded+3
model-00006-of-000163.safetensorsAdded+3
model-00007-of-000163.safetensorsAdded+3
model-00008-of-000163.safetensorsAdded+3
model-00009-of-000163.safetensorsAdded+3
model-00010-of-000163.safetensorsAdded+3
model-00011-of-000163.safetensorsAdded+3
model-00012-of-000163.safetensorsAdded+3
model-00013-of-000163.safetensorsAdded+3
model-00014-of-000163.safetensorsAdded+3
model-00015-of-000163.safetensorsAdded+3
model-00016-of-000163.safetensorsAdded+3
model-00017-of-000163.safetensorsAdded+3
model-00018-of-000163.safetensorsAdded+3
model-00019-of-000163.safetensorsAdded+3
model-00020-of-000163.safetensorsAdded+3
model-00021-of-000163.safetensorsAdded+3
model-00022-of-000163.safetensorsAdded+3
model-00023-of-000163.safetensorsAdded+3
model-00024-of-000163.safetensorsAdded+3
model-00025-of-000163.safetensorsAdded+3
model-00026-of-000163.safetensorsAdded+3
model-00027-of-000163.safetensorsAdded+3
model-00028-of-000163.safetensorsAdded+3
model-00029-of-000163.safetensorsAdded+3
model-00030-of-000163.safetensorsAdded+3
model-00031-of-000163.safetensorsAdded+3
model-00032-of-000163.safetensorsAdded+3
model-00033-of-000163.safetensorsAdded+3
model-00034-of-000163.safetensorsAdded+3
model-00035-of-000163.safetensorsAdded+3
model-00036-of-000163.safetensorsAdded+3
model-00037-of-000163.safetensorsAdded+3
model-00038-of-000163.safetensorsAdded+3
model-00039-of-000163.safetensorsAdded+3
model-00040-of-000163.safetensorsAdded+3
model-00041-of-000163.safetensorsAdded+3
model-00042-of-000163.safetensorsAdded+3
model-00043-of-000163.safetensorsAdded+3