Downloads · 30 days
9
7% of all-time downloads
Sashank-810/llama3.1-8b-lft-lora
llama3.1-8b-lft-lora is a text generation model from Sashank-810. 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.1.
LoRA-finetuned meta-llama/Llama-3.1-8B-Instruct on a structured math reasoning corpus with explicit chain-of-thought, topic coverage signals, and representation hints. The repo contains merged weights (no separate ada…
Downloads · 30 days
9
7% of all-time downloads
All-time downloads
131
Public
Parameters
8B
16.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README
LoRA-finetuned meta-llama/Llama-3.1-8B-Instruct on a structured math reasoning corpus with explicit chain-of-thought, topic coverage signals, and representation hints. The repo contains merged weights (no separate adapter load required) plus a Llama-3.1-style chat template.
meta-llama/Llama-3.1-8B-Instructchat_template.jinja for chat formattingllama3.1-8b-lft-lora on the Hugging Face Hub (replace with your handle, e.g., Sashank-810/llama3.1-8b-lft-lora)covered_nodes, used_edges, operations (informative, not required at inference).import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Sashank-810/llama3.1-8b-lft-lora" # replace with your handle
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
messages = [
{"role": "system", "content": "You are a math tutor. Show compact reasoning, then the final answer."},
{"role": "user", "content": "How many distinct 7-letter words can be made from BANANA?"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.6, top_p=0.9)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from vllm import LLM, SamplingParams
model_id = "Sashank-810/llama3.1-8b-lft-lora"
llm = LLM(model=model_id, tokenizer=model_id, trust_remote_code=True)
messages = [
{"role": "system", "content": "You are a math tutor. Show compact reasoning, then the final answer."},
{"role": "user", "content": "Explain the break-even quantity when cost=40000+12x and revenue=25x."},
]
prompt = llm.get_tokenizer().apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
sampling = SamplingParams(temperature=0.6, top_p=0.9, max_tokens=256)
out = llm.generate([prompt], sampling_params=sampling)
print(out[0].outputs[0].text)
Run the OpenAI-compatible server:
python -m vllm.entrypoints.openai.api_server \
--model Sashank-810/llama3.1-8b-lft-lora \
--trust-remote-code \
--max-model-len 1536
topic, question, chain_of_thought_reasoning, final_answer, covered_nodes, used_edges, operations, repr_path..safetensors plus model.safetensors.index.json.If you use this model, please cite the base model and this finetune.
@misc{lft-lora-2025,
title = {LFT-LoRA: Structured Math Reasoning LoRA on Llama-3.1-8B-Instruct},
year = {2025},
note = {Finetuned from meta-llama/Llama-3.1-8B-Instruct},
}