Downloads · 30 days
14
2% of all-time downloads
nassimjp/Ministral-8B-Instruct-2410-4bit
Ministral-8B-Instruct-2410-4bit is a text generation model from nassimjp. Use it when you need the model to write or continue text. The card lists the license as other.
This repository contains a 4-bit quantized, text-only optimized version of Mistral AI's Ministral-8B-Instruct-2410. The model was quantized and patched locally using Unsloth to ensure minimal VRAM footprint and maximu…
Downloads · 30 days
14
2% of all-time downloads
All-time downloads
752
Public
Parameters
8.2B
5.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.7 GB · 100%
How the weights are stored.
U87.2B · 87%
From the Hugging Face model README
This repository contains a 4-bit quantized, text-only optimized version of Mistral AI's Ministral-8B-Instruct-2410. The model was quantized and patched locally using Unsloth to ensure minimal VRAM footprint and maximum training/inference efficiency on consumer-grade hardware (such as 16GB VRAM GPUs like the RTX 4070 Ti SUPER).
MistralForCausalLM). Unlike multi-modal variants, this model is stripped of vision configurations to prevent VRAM overhead and text generation corruption (word salad issues).nf4) via bitsandbytes embedded directly into the shards.full_attention and sliding_attention layers (36 layers total), preserving deep contextual relationships over long inference steps.To use this model seamlessly without triggering Hugging Face's weight reversion issues (NotImplementedError), load it directly using Unsloth's fast patching pipeline.
Make sure you have unsloth, torch, and transformers installed in your environment:
pip install unsloth
import torch
from unsloth import FastLanguageModel
max_seq_length = 4096
dtype = None # Auto-detects (bfloat16 for modern GPUs)
load_in_4bit = True
# Load optimized 4-bit model directly from this Hub repo
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "nassimjp/Ministral-8B-Instruct-2410-4bit",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
device_map = "auto"
)
FastLanguageModel.for_inference(model)
# Standard Chat Template Test
messages = [{"role": "user", "content": "سلام، په پښتو ژبه ووایه چې ته څوک یې؟"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=100, temperature=0.7, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
If you are setting up this model for downstream tasks (such as specialized Pashto reasoning/CoT data alignment), initialize your LoRA target modules like this:
model = FastLanguageModel.get_peft_model(
model,
r = 16,
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"],
lora_alpha = 16,
lora_dropout = 0,
bias = "none",
use_gradient_checkpointing = "unsloth", # Crucial for 16GB VRAM hardware safety
random_state = 3407,
use_rslora = False,
)
print("✅ Ready for V7 fine-tuning sequence.")
pad_token = <pad> to ensure matrix mathematical safety during batched sequences.model_type: "mistral". Avoid manual conversion to vision/conditional blocks to maintain stability.mistral-research license.