Instructions to use trl-internal-testing/tiny-NemotronHForCausalLM-super with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-NemotronHForCausalLM-super with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="trl-internal-testing/tiny-NemotronHForCausalLM-super") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("trl-internal-testing/tiny-NemotronHForCausalLM-super") model = AutoModelForCausalLM.from_pretrained("trl-internal-testing/tiny-NemotronHForCausalLM-super", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use trl-internal-testing/tiny-NemotronHForCausalLM-super with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trl-internal-testing/tiny-NemotronHForCausalLM-super" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-NemotronHForCausalLM-super", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trl-internal-testing/tiny-NemotronHForCausalLM-super
- SGLang
How to use trl-internal-testing/tiny-NemotronHForCausalLM-super 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 "trl-internal-testing/tiny-NemotronHForCausalLM-super" \ --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": "trl-internal-testing/tiny-NemotronHForCausalLM-super", "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 "trl-internal-testing/tiny-NemotronHForCausalLM-super" \ --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": "trl-internal-testing/tiny-NemotronHForCausalLM-super", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use trl-internal-testing/tiny-NemotronHForCausalLM-super with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-NemotronHForCausalLM-super
Upload NemotronHForCausalLM
Browse files- config.json +9 -6
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -26,14 +26,14 @@
|
|
| 26 |
"mamba_num_heads": 8,
|
| 27 |
"mamba_proj_bias": false,
|
| 28 |
"mamba_ssm_cache_dtype": "float32",
|
| 29 |
-
"max_position_embeddings":
|
| 30 |
"mlp_bias": false,
|
| 31 |
"mlp_hidden_act": "relu2",
|
| 32 |
"model_type": "nemotron_h",
|
| 33 |
"moe_intermediate_size": 32,
|
| 34 |
-
"moe_latent_size":
|
| 35 |
"moe_shared_expert_intermediate_size": 32,
|
| 36 |
-
"moe_shared_expert_overlap":
|
| 37 |
"mtp_layers_block_type": [
|
| 38 |
"attention",
|
| 39 |
"moe"
|
|
@@ -42,16 +42,19 @@
|
|
| 42 |
"n_groups": 1,
|
| 43 |
"n_routed_experts": 4,
|
| 44 |
"n_shared_experts": 1,
|
|
|
|
| 45 |
"norm_topk_prob": true,
|
| 46 |
"num_attention_heads": 4,
|
| 47 |
"num_experts_per_tok": 2,
|
| 48 |
"num_key_value_heads": 2,
|
| 49 |
"num_logits_to_keep": 1,
|
| 50 |
-
"num_nextn_predict_layers":
|
| 51 |
"pad_token_id": 0,
|
|
|
|
| 52 |
"rescale_prenorm_residual": true,
|
| 53 |
"residual_in_fp32": false,
|
| 54 |
-
"
|
|
|
|
| 55 |
"sliding_window": null,
|
| 56 |
"ssm_state_size": 16,
|
| 57 |
"tie_word_embeddings": false,
|
|
@@ -69,6 +72,6 @@
|
|
| 69 |
"use_bias": false,
|
| 70 |
"use_cache": true,
|
| 71 |
"use_conv_bias": true,
|
| 72 |
-
"use_mamba_kernels":
|
| 73 |
"vocab_size": 131072
|
| 74 |
}
|
|
|
|
| 26 |
"mamba_num_heads": 8,
|
| 27 |
"mamba_proj_bias": false,
|
| 28 |
"mamba_ssm_cache_dtype": "float32",
|
| 29 |
+
"max_position_embeddings": 262144,
|
| 30 |
"mlp_bias": false,
|
| 31 |
"mlp_hidden_act": "relu2",
|
| 32 |
"model_type": "nemotron_h",
|
| 33 |
"moe_intermediate_size": 32,
|
| 34 |
+
"moe_latent_size": 32,
|
| 35 |
"moe_shared_expert_intermediate_size": 32,
|
| 36 |
+
"moe_shared_expert_overlap": false,
|
| 37 |
"mtp_layers_block_type": [
|
| 38 |
"attention",
|
| 39 |
"moe"
|
|
|
|
| 42 |
"n_groups": 1,
|
| 43 |
"n_routed_experts": 4,
|
| 44 |
"n_shared_experts": 1,
|
| 45 |
+
"norm_eps": 1e-05,
|
| 46 |
"norm_topk_prob": true,
|
| 47 |
"num_attention_heads": 4,
|
| 48 |
"num_experts_per_tok": 2,
|
| 49 |
"num_key_value_heads": 2,
|
| 50 |
"num_logits_to_keep": 1,
|
| 51 |
+
"num_nextn_predict_layers": 1,
|
| 52 |
"pad_token_id": 0,
|
| 53 |
+
"partial_rotary_factor": 1.0,
|
| 54 |
"rescale_prenorm_residual": true,
|
| 55 |
"residual_in_fp32": false,
|
| 56 |
+
"rope_theta": 10000,
|
| 57 |
+
"routed_scaling_factor": 5.0,
|
| 58 |
"sliding_window": null,
|
| 59 |
"ssm_state_size": 16,
|
| 60 |
"tie_word_embeddings": false,
|
|
|
|
| 72 |
"use_bias": false,
|
| 73 |
"use_cache": true,
|
| 74 |
"use_conv_bias": true,
|
| 75 |
+
"use_mamba_kernels": true,
|
| 76 |
"vocab_size": 131072
|
| 77 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:28045fd1aa7046f6cc4473d029f2c37891bc8144d70cb1a9e3d81c014c3ef3ab
|
| 3 |
+
size 8467080
|