🚀 Nuke_X_Gemma3_1B_Reasoner_Testing
Enhanced Gemma model with improved reasoning capabilities by Nuclear AI
🚀 Quick Start
This README provides details about the Nuke_X_Gemma3_1B_Reasoner_Testing
model, including its development, installation, and usage.
✨ Features
- Enhanced Reasoning: Leveraging GRPO and a specialized dataset, this model improves the reasoning capabilities of the base Gemma model.
- Experimental Fine - Tuning: Fine - tuned with 150 rows of high - quality data over five steps in about 30 minutes.
📦 Installation
Installing Libraries
pip install --no-deps git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3
pip install "unsloth[colab-new]@git+https://github.com/unslothai/unsloth.git"
pip install accelerate bitsandbytes
💻 Usage Examples
Basic Usage
import torch
from unsloth import FastModel
from transformers import TextStreamer
max_seq_length = 1024
model_name = "NuclearAi/Nuke_X_Gemma3_1B_Reasoner_Testing"
print(f"Loading model: {model_name}...")
model, tokenizer = FastModel.from_pretrained(
model_name = model_name,
max_seq_length = max_seq_length,
dtype = None,
load_in_4bit = False,
device_map = "auto",
)
print("Model loaded.")
reasoning_start = "<think>"
reasoning_end = "</think>"
solution_start = "<response>"
solution_end = "</response>"
system_prompt = \
f"""You are given a problem.
Think about the problem and provide your working out.
Place it between {reasoning_start} and {reasoning_end}.
Then, provide your solution between {solution_start}{solution_end}"""
user_question = "Write a short story about a cat who learns to fly."
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_question},
]
text_input = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
device = model.device if hasattr(model, 'device') else ('cuda' if torch.cuda.is_available() else 'cpu')
inputs = tokenizer([text_input], return_tensors="pt").to(device)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
print("\n--- Model Response ---")
with torch.no_grad():
outputs = model.generate(
**inputs,
streamer=streamer,
max_new_tokens=1024,
temperature=0.7,
top_p=0.9,
top_k=50,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
print("\n--- End of Response ---")
📚 Documentation
About Model
- Developed by: NuclearAi
- License: apache-2.0
- Finetuned from model : google/gemma-3-1b-it
Gemma is a family of lightweight, state-of-the-art open models from Google, built using the same research and technology as the Gemini models. However, Gemma lacks in the reasoning capabilities, making it less advanced compared to some other models.
At Nuclear AI, we enhance Gemma’s abilities by leveraging GRPO and providing it with a specialized dataset to improve its reasoning skills. Since this is an experimental model, we have used 150 rows of high-quality data and performed five steps of fine-tuning, which takes around 30 minutes.
When we tested the model, we were truly impressed by its performance! We would love to hear your feedback so we can work on fine-tuning a larger version with more steps and greater computational power.
Model Information
Property |
Details |
Base Model |
google/gemma-3-1b-it |
Tags |
text-generation-inference, transformers, unsloth, GRPO, conversational, gemma3_text, reasoning |
License |
apache-2.0 |
Language |
en |
Datasets |
NuclearAi/HyperThink-v1 |
📄 License
This model is released under the apache-2.0
license.
Thank you for your support !
Jay Shree Ram 🚩🚩