NFT-7B

81
2
7.0B
1 language
by
nvidia
Language Model
OTHER
7B params
New
81 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
16GB+ RAM
Mobile
Laptop
Server
Quick Summary

AI model with specialized capabilities.

Device Compatibility

Mobile
4-6GB RAM
Laptop
16GB RAM
Server
GPU
Minimum Recommended
7GB+ RAM

Code Examples

text
L_NFT(θ) = r[-log(π_θ⁺(a|q) / π(a|q))] + (1-r)[-log((1 - r_q * (π_θ⁺(a|q) / π(a|q))) / (1-r_q))]
text
L_NFT(θ) = r[-log(π_θ⁺(a|q) / π(a|q))] + (1-r)[-log((1 - r_q * (π_θ⁺(a|q) / π(a|q))) / (1-r_q))]
text
L_NFT(θ) = r[-log(π_θ⁺(a|q) / π(a|q))] + (1-r)[-log((1 - r_q * (π_θ⁺(a|q) / π(a|q))) / (1-r_q))]
text
L_NFT(θ) = r[-log(π_θ⁺(a|q) / π(a|q))] + (1-r)[-log((1 - r_q * (π_θ⁺(a|q) / π(a|q))) / (1-r_q))]
Example math problempythontransformers
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "nvidia/NFT-7B"
device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Example math problem
problem = "Find the value of $x$ that satisfies the equation $\\sqrt{x+7} = x-5$."

# Format the prompt to encourage step-by-step reasoning
prompt = f"{problem}\nPlease reason step by step, and put your final answer within \\boxed{{}}."

messages = [
    {"role": "user", "content": prompt}
]

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

# Generate response
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512,
    temperature=0  # Use 0 for deterministic output
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
Example math problempythontransformers
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "nvidia/NFT-7B"
device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Example math problem
problem = "Find the value of $x$ that satisfies the equation $\\sqrt{x+7} = x-5$."

# Format the prompt to encourage step-by-step reasoning
prompt = f"{problem}\nPlease reason step by step, and put your final answer within \\boxed{{}}."

messages = [
    {"role": "user", "content": prompt}
]

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

# Generate response
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512,
    temperature=0  # Use 0 for deterministic output
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
Example math problempythontransformers
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "nvidia/NFT-7B"
device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Example math problem
problem = "Find the value of $x$ that satisfies the equation $\\sqrt{x+7} = x-5$."

# Format the prompt to encourage step-by-step reasoning
prompt = f"{problem}\nPlease reason step by step, and put your final answer within \\boxed{{}}."

messages = [
    {"role": "user", "content": prompt}
]

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

# Generate response
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512,
    temperature=0  # Use 0 for deterministic output
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
Example math problempythontransformers
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "nvidia/NFT-7B"
device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Example math problem
problem = "Find the value of $x$ that satisfies the equation $\\sqrt{x+7} = x-5$."

# Format the prompt to encourage step-by-step reasoning
prompt = f"{problem}\nPlease reason step by step, and put your final answer within \\boxed{{}}."

messages = [
    {"role": "user", "content": prompt}
]

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

# Generate response
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512,
    temperature=0  # Use 0 for deterministic output
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.