🚀 モデル概要
このモデルは、Googleの軽量で最先端のオープンモデルであるGemmaをベースに、Nuclear AIによって改良されたものです。GemmaはGeminiモデルと同じ研究と技術を用いて構築されていますが、推論能力に欠けるため、他の一部のモデルと比べてやや劣っています。Nuclear AIでは、GRPOを活用し、特殊なデータセットを提供することで、Gemmaの推論能力を向上させています。
プロパティ |
詳細 |
ベースモデル |
google/gemma-3-1b-it |
タグ |
text-generation-inference, transformers, unsloth, GRPO, conversational, gemma3_text, reasoning |
ライセンス |
apache-2.0 |
言語 |
en |
データセット |
NuclearAi/HyperThink-v1 |
🚀 クイックスタート
モデルについて
- 開発者: NuclearAi
- ライセンス: apache-2.0
- ファインチューニング元のモデル: google/gemma-3-1b-it
Gemma はGoogleによる軽量で最先端のオープンモデルファミリーで、Gemini モデルと同じ研究と技術を用いて構築されています。ただし、Gemmaは推論能力に欠けており、他の一部のモデルと比べると先進性に劣ります。
Nuclear AI では、GRPO を活用し、特殊なデータセットを提供することで、Gemmaの能力を強化し、推論スキルを向上させています。これは実験的なモデルであり、150行の高品質データ を使用し、5ステップのファインチューニング を行いました。このファインチューニングには約30分かかります。
モデルをテストしたところ、その性能に本当に感銘を受けました!あなたのフィードバックを聞きたいです。それを元に、より多くのステップと計算能力を使った、より大規模なバージョンのファインチューニングを行いたいと思っています。
📦 インストール
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
💻 使用例
基本的な使用法
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 ---")
ご支援いただき、ありがとうございます!
Jay Shree Ram 🚩🚩