Downloads · 30 days
9
10% of all-time downloads
Narthanan/Llama-3.2-1B-NarthananMath_1M-V1
Llama-3.2-1B-NarthananMath_1M-V1 is a text generation model from Narthanan. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama3.2.
Downloads · 30 days
9
10% of all-time downloads
All-time downloads
87
Public
Parameters
1.2B
2.5 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2.5 GB · 99%
From the Hugging Face model README
A 1-billion parameter language model.
unsloth/Llama-3.2-1B-InstructThis model is intended for direct use in applications requiring mathematical reasoning, such as:
The model is not intended for, and its performance may be degraded on:
Limitations:
Recommendations Users should be aware of the model's specialized nature and always apply critical evaluation to its outputs. It is best used as an assistive tool alongside human expertise.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "Narthanan/Llama-3.2-1B-NarthananMath_1M-V1"
print("loading model...")
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)
print(f"Running on {device}. You can now interact with the model.")
while True:
user_input = input("You: ")
if user_input.lower() in ["exit", "quit"]:
break
inputs = tokenizer.encode(user_input + tokenizer.eos_token, return_tensors="pt").to(device)
with torch.no_grad():
output_tokens = model.generate(
inputs,
max_length=2000,
do_sample=True,
top_k=50,
top_p=0.95,
pad_token_id=tokenizer.eos_token_id,
temperature=0.6
)
response = tokenizer.decode(output_tokens[:, inputs.shape[-1]:][0], skip_special_tokens=True)
print(f"Model: {response}")