Text Generation
Transformers
Safetensors
PyTorch
nemotron_h
nvidia
nemotron-3
latent-moe
mtp
conversational
custom_code
Run this model with HF Jobs
Run nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding", trust_remote_code=True) 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("nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding", trust_remote_code=True, 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 nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding
- SGLang
How to use nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding 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 "nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding" \ --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": "nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding", "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 "nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding" \ --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": "nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding with Docker Model Runner:
docker model run hf.co/nvidia/NVIDIA-Nemotron-Labs-Teacher-Competition-Coding
Add a response template and generation tags
#1
by Rocketknight1 HF Staff - opened
Files changed (2)
- chat_template.jinja+27-5
- tokenizer_config.json+39-1
108 unmodified lines10911011111211311411511627 unmodified lines1441451461471481491501511521531 unmodified line155156157158159160161162163164165166108 unmodified lines{%- set content = content -%}{%- endif -%}{%- endif %}{%- if message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}{{- '<|im_start|>assistant\n' }}{%- set include_content = not (truncate_history_thinking and loop.index0 < ns.last_user_idx) %}{%- if content is string and content | trim | length > 0 %}{%- if include_content %}27 unmodified lines{%- endif %}{{- '</function>\n</tool_call>\n' -}}{%- endfor %}{{- '<|im_end|>\n' }}{%- else %}{%- if not (truncate_history_thinking and loop.index0 < ns.last_user_idx) %}{{- '<|im_start|>assistant\n' ~ (content | default('', true) | string | trim) ~ '<|im_end|>\n' }}{%- else %}{%- set c = (content | default('', true) | string) %}{%- if '<think>' in c and '</think>' in c %}1 unmodified line{%- endif %}{%- set c = c | trim %}{%- if c | length > 0 %}{{- '<|im_start|>assistant\n' ~ c ~ '<|im_end|>\n' }}{%- else %}{{- '<|im_start|>assistant\n<|im_end|>\n' }}{%- endif %}{%- endif %}{%- endif %}{%- elif message.role == "user" or message.role == "system" %}{{- '<|im_start|>' + message.role + '\n' }}{%- set content = message.content | string %}108 unmodified lines10911011111211311411511611727 unmodified lines1451461471481491501511521531541 unmodified line156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188108 unmodified lines{%- set content = content -%}{%- endif -%}{%- endif %}{{- '<|im_start|>assistant\n' }}{%- set turn %}{%- if message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}{%- set include_content = not (truncate_history_thinking and loop.index0 < ns.last_user_idx) %}{%- if content is string and content | trim | length > 0 %}{%- if include_content %}27 unmodified lines{%- endif %}{{- '</function>\n</tool_call>\n' -}}{%- endfor %}{{- '<|im_end|>' }}{%- else %}{%- if not (truncate_history_thinking and loop.index0 < ns.last_user_idx) %}{{- (content | default('', true) | string | trim) ~ '<|im_end|>' }}{%- else %}{%- set c = (content | default('', true) | string) %}{%- if '<think>' in c and '</think>' in c %}1 unmodified line{%- endif %}{%- set c = c | trim %}{%- if c | length > 0 %}{{- c ~ '<|im_end|>' }}{%- else %}{{- '<|im_end|>' }}{%- endif %}{%- endif %}{%- endif %}{%- endset %}{#- What the generation prompt pre-fills stays out of the generation block: the model never generates it #}{%- set prefill = '<think>\n' if enable_thinking else '<think></think>' %}{%- if turn.startswith(prefill) %}{%- set lead = prefill %}{%- elif not turn.startswith('<think>') %}{%- set lead = '' %}{%- elif enable_thinking or '</think>' not in turn %}{%- set lead = '<think>' %}{%- else %}{#- Reasoning with thinking off: the prompt pre-fills an empty block, so the whole block stays out #}{%- set lead = turn.split('</think>')[0] ~ '</think>' %}{%- if turn[lead | length:].startswith('\n') %}{%- set lead = lead ~ '\n' %}{%- endif %}{%- endif %}{{- lead }}{%- generation %}{{- turn[lead | length:] }}{%- endgeneration %}{{- '\n' }}{%- elif message.role == "user" or message.role == "system" %}{{- '<|im_start|>' + message.role + '\n' }}{%- set content = message.content | string %}
8014 unmodified lines801580168017801880198014 unmodified lines"model_max_length": 262144,"pad_token": "<|im_end|>","tokenizer_class": "PreTrainedTokenizerFast","unk_token": "<unk>"}8014 unmodified lines80158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578014 unmodified lines"model_max_length": 262144,"pad_token": "<|im_end|>","tokenizer_class": "PreTrainedTokenizerFast","unk_token": "<unk>","response_template": {"defaults": {"role": "assistant"},"start_anchor": "<|im_start|>assistant\n","fields": {"reasoning_content": {"open": "<think>","close": "</think>","content": "text"},"tool_calls": {"open_pattern": "<tool_call>\\s*<function=(?P<name>[^>\\n]+)>","close_pattern": "</tool_call>|(?=<tool_call>)","repeats": true,"content": "xml-inline","content_args": {"tag_pattern": "<parameter=(?P<key>[^>\\n]+)>\\n?(?P<value>.*?)\\n?(?:</parameter>|(?=<parameter=)|(?=</function>))"},"transform": {"type": "function","function": {"name": "{name}","arguments": "{content}"}}},"content": {"close": ["<|im_end|>","<|endoftext|>"],"content": "text","repeats": true,"join": ""}}}}
chat_template.jinja+27-5
tokenizer_config.json+39-1