Run this model with HF Jobs
Run nvidia/AMPLIFY_350M 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 to fine-tune https://huggingface.co/nvidia/AMPLIFY_350M. 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/AMPLIFY_350M 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.
Instructions to use nvidia/AMPLIFY_350M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/AMPLIFY_350M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="nvidia/AMPLIFY_350M", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("nvidia/AMPLIFY_350M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse filesFiles changed (3)
- amplify_te.py+11-2
- config.json+2-1
- model.safetensors+2-2
33 unmodified lines34353637383916 unmodified lines56575859606115 unmodified lines777879808182838485868726 unmodified lines114115116117118119120124 unmodified lines24524624724824925025140 unmodified lines29229329429529629733 unmodified lineslayer_norm_after_embedding: bool = False,layer_norm_before_last_layer: bool = True,vocab_size: int = 27,ffn_bias: bool = False,att_bias: bool = False,pad_token_id: int = 0,16 unmodified lineslayer_norm_after_embedding (bool): Whether to use layer normalization after the embedding.layer_norm_before_last_layer (bool): Whether to use layer normalization before the last layer.vocab_size (int): The vocabulary size of the model.ffn_bias (bool): Whether to use bias in the feedforward network.att_bias (bool): Whether to use bias in the attention.pad_token_id (int): The padding token id.15 unmodified linesself.layer_norm_after_embedding = layer_norm_after_embeddingself.layer_norm_before_last_layer = layer_norm_before_last_layerself.vocab_size = vocab_sizeself.ffn_bias = ffn_biasself.att_bias = att_biasself.pad_token_id = pad_token_idself.max_length = max_lengthclass AMPLIFYPreTrainedModel(PreTrainedModel):"""AMPLIFY pre-trained model."""26 unmodified linesself.config = configself.encoder = nn.Embedding(config.vocab_size,config.hidden_size,padding_idx=config.pad_token_id,dtype=config.torch_dtype,124 unmodified linesif config.layer_norm_before_last_layer:self.decoder = transformer_engine.pytorch.LayerNormLinear(config.hidden_size,config.vocab_size,config.norm_eps,params_dtype=config.torch_dtype,normalization="RMSNorm" if config.rms_norm else "LayerNorm",40 unmodified lines# Classification head with layer normlogits = self.decoder(outputs.last_hidden_state)if labels is not None:loss = nn.functional.cross_entropy(logits.view(-1, logits.size(-1)), labels.view(-1))33 unmodified lines3435363738394016 unmodified lines5758596061626315 unmodified lines7980818283848586878889909192939426 unmodified lines121122123124125126127124 unmodified lines25225325425525625725840 unmodified lines29930030130230330430530633 unmodified lineslayer_norm_after_embedding: bool = False,layer_norm_before_last_layer: bool = True,vocab_size: int = 27,padded_vocab_size: int = 32,ffn_bias: bool = False,att_bias: bool = False,pad_token_id: int = 0,16 unmodified lineslayer_norm_after_embedding (bool): Whether to use layer normalization after the embedding.layer_norm_before_last_layer (bool): Whether to use layer normalization before the last layer.vocab_size (int): The vocabulary size of the model.padded_vocab_size (int): The padded vocabulary size of the model to support fp8.ffn_bias (bool): Whether to use bias in the feedforward network.att_bias (bool): Whether to use bias in the attention.pad_token_id (int): The padding token id.15 unmodified linesself.layer_norm_after_embedding = layer_norm_after_embeddingself.layer_norm_before_last_layer = layer_norm_before_last_layerself.vocab_size = vocab_sizeself.padded_vocab_size = padded_vocab_sizeself.ffn_bias = ffn_biasself.att_bias = att_biasself.pad_token_id = pad_token_idself.max_length = max_lengthassert self.padded_vocab_size >= self.vocab_size, ("padded_vocab_size must be greater than or equal to vocab_size")class AMPLIFYPreTrainedModel(PreTrainedModel):"""AMPLIFY pre-trained model."""26 unmodified linesself.config = configself.encoder = nn.Embedding(config.padded_vocab_size,config.hidden_size,padding_idx=config.pad_token_id,dtype=config.torch_dtype,124 unmodified linesif config.layer_norm_before_last_layer:self.decoder = transformer_engine.pytorch.LayerNormLinear(config.hidden_size,config.padded_vocab_size,config.norm_eps,params_dtype=config.torch_dtype,normalization="RMSNorm" if config.rms_norm else "LayerNorm",40 unmodified lines# Classification head with layer normlogits = self.decoder(outputs.last_hidden_state)if self.config.padded_vocab_size != self.config.vocab_size:logits = logits[:, :, : self.config.vocab_size]if labels is not None:loss = nn.functional.cross_entropy(logits.view(-1, logits.size(-1)), labels.view(-1))
27 unmodified lines2829303132333435363727 unmodified lines"num_hidden_layers": 32,"other_special_token_ids": null,"pad_token_id": 0,"pre_activation_layer_norm": true,"rms_norm": true,"torch_dtype": "float32","transformers_version": "4.54.0.dev0","unk_token_id": 1,"vocab_path": "conf/tokenizer/amplify_vocab.txt","vocab_size": 2727 unmodified lines282930313233343536373827 unmodified lines"num_hidden_layers": 32,"other_special_token_ids": null,"pad_token_id": 0,"padded_vocab_size": 32,"pre_activation_layer_norm": true,"rms_norm": true,"torch_dtype": "float32","transformers_version": "4.53.2","unk_token_id": 1,"vocab_path": "conf/tokenizer/amplify_vocab.txt","vocab_size": 27
123version https://git-lfs.github.com/spec/v1oid sha256:2df10849de933a3d9917ae2bf543154ffe77091d9c84f4cbb384d666f48dfd03size 1416078404123version https://git-lfs.github.com/spec/v1oid sha256:821e89362bf8b393963d70dfd70a4b60f0bb6a83f485785526531f8bb8f26060size 1416116824
amplify_te.py+11-2
config.json+2-1
model.safetensors+2-2