PJMixers-Dev/dolphin-deepseek-1k-think-1k-response-filtered-ShareGPT
Viewer • Updated • 86.1k • 49
How to use Mercity/mamba-790m-resoning with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("state-spaces/mamba-790m-hf")
model = PeftModel.from_pretrained(base_model, "Mercity/mamba-790m-resoning")Fine-tuned Mamba-790M model for evaluating reasoning trace faithfulness in language models.
This is a LoRA-adapted version of Mamba-790M trained to generate responses that faithfully follow provided reasoning traces.
This model is designed for research on:
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
# Load model
base_model = AutoModelForCausalLM.from_pretrained(
"state-spaces/mamba-790m-hf",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto"
)
model = PeftModel.from_pretrained(base_model, "NakshJain/mamba-790m-resoning")
tokenizer = AutoTokenizer.from_pretrained("state-spaces/mamba-790m-hf", trust_remote_code=True)
# Format: <user>question</user><think>reasoning</think><answer>
prompt = "<user>What is 15 + 27?</user><think>Let me add: 15 + 27 = 42</think><answer>"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
# Output: 42
<user>query</user><think>reasoning</think><answer>response</answer>in_proj, x_proj, dt_projIf you use this model, please cite:
@misc{mamba-reasoning-faithfulness-2024,
author = {Naksh Jain},
title = {Mamba-790M Reasoning Faithfulness Model},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/NakshJain/mamba-790m-resoning}
}
Apache 2.0 (inherits from base Mamba model)
Base model
state-spaces/mamba-790m-hf