gemma-tuner-multimodal
БесплатноБез исполняемых скриптовНе проверенFine-tune Gemma 4 and 3n models with audio, images, and text on Apple Silicon using PyTorch and Metal Performance Shaders.
от reason-machines★ 99 звёзд на GitHubОб этом скилле
Gemma Multimodal Fine-Tuner
Skill by ara.so — Daily 2026 Skills collection.
Fine-tune Gemma 4 and Gemma 3n models on text, images, and audio data entirely on Apple Silicon (MPS), with support for streaming large datasets from GCS/BigQuery without filling local storage.
What It Does
- Text LoRA: instruction-tuning or completion fine-tuning from local CSV
- Image + Text LoRA: captioning and VQA from local CSV
- Audio + Text LoRA: the only Apple-Silicon-native path for this modality
- Cloud streaming: train on terabytes from GCS/BigQuery without local copy
- MPS-native: no NVIDIA GPU required — runs on MacBook Pro/Air/Mac Studio
Installation
Prerequisites
- macOS 12.3+ with Apple Silicon (arm64)
- Python 3.10+ (native arm64, not Rosetta)
- Hugging Face account with Gemma access
# Install Python 3.12 if needed
brew install [email protected]
# Create venv
python3.12 -m venv .venv
source .venv/bin/activate
# Verify arm64 (must show arm64, not x86_64)
python -c "import platform; print(platform.machine())"
# Install PyTorch
pip install torch torchaudio
# Clone and install
git clone https://github.com/mattmireles/gemma-tuner-multimodal
cd gemma-tuner-multimodal
pip install -e .
# For Gemma 4 support (separate venv recommended)
pip install -r requirements/requirements-gemma4.txt
Authenticate with Hugging Face
huggingface-cli login
# Or set environment variable:
export HF_TOKEN=your_token_here
CLI Commands
# Check system is ready
gemma-macos-tuner system-check
# Guided setup wizard (recommended for first run)
gemma-macos-tuner wizard
# Prepare dataset
gemma-macos-tuner prepare <dataset-profile>
# Fine-tune a model
gemma-macos-tuner finetune <profile> --json-logging
# Evaluate a run
gemma-macos-tuner evaluate <profile-or-run>
# Export merged HF/SafeTensors (merges LoRA when adapter_config.json present)
gemma-macos-tuner export <run-dir-or-profile>
# Blacklist bad samples from errors
gemma-macos-tuner blacklist <profile>
# List training runs
gemma-macos-tuner runs list
Configuration (config/config.ini)
The config is hierarchical INI: defaults → groups → models → datasets → profiles.
[defaults]
output_dir = output
batch_size = 2
gradient_accumulation_steps = 8
learning_rate = 2e-4
num_train_epochs = 3
[model:gemma-3n-e2b-it]
group = gemma
base_model = google/gemma-3n-E2B-it
[model:gemma-4-e2b-it]
group = gemma
base_model = google/gemma-4-E2B-it
[dataset:my-audio-dataset]
data_dir = data/datasets/my-audio-dataset
audio_column = audio_path
text_column = transcript
[profile:my-audio-profile]
model = gemma-3n-e2b-it
dataset = my-audio-dataset
modality = audio
lora_r = 16
lora_alpha = 32
lora_dropout = 0.05
max_seq_length = 512
Use GEMMA_TUNER_CONFIG env var to point to config outside repo root:
export GEMMA_TUNER_CONFIG=/path/to/my/config.ini
Modality Configuration
Text-Only Fine-Tuning
Instruction tuning (user/assistant pairs):
[profile:text-instruction]
model = gemma-3n-e2b-it
dataset = my-text-dataset
modality = text
text_sub_mode = instruction
prompt_column = prompt
text_column = response
max_seq_length = 2048
lora_r = 16
lora_alpha = 32
Completion tuning (full sequence trained):
[profile:text-completion]
model = gemma-3n-e2b-it
dataset = my-text-dataset
modality = text
text_sub_mode = completion
text_column = text
max_seq_length = 2048
CSV format for instruction tuning (data/datasets/my-text-dataset/train.csv):
prompt,response
"What is photosynthesis?","Photosynthesis is the process by which plants..."
"Explain LoRA fine-tuning","LoRA (Low-Rank Adaptation) is a parameter-efficient..."
Image Fine-Tuning
[profile:image-caption]
model = gemma-3n-e2b-it
dataset = my-image-dataset
modality = image
image_sub_mode = captioning
image_token_budget = 256
prompt_column = prompt
text_column = caption
max_seq_length = 512
CSV format (data/datasets/my-image-dataset/train.csv):
image_path,prompt,caption
/data/images/img1.jpg,Describe this image,A dog sitting on a green lawn...
/data/images/img2.jpg,What is shown here,A bar chart showing quarterly revenue...
Audio Fine-Tuning
[profile:audio-asr]
model = gemma-3n-e2b-it
dataset = my-audio-dataset
modality = audio
audio_column = audio_path
text_column = transcript
max_seq_length = 512
lora_r = 16
lora_alpha = 32
lora_dropout = 0.05
CSV format (data/datasets/my-audio-dataset/train.csv):
audio_path,transcript
/data/audio/recording1.wav,The patient presents with acute respiratory symptoms
/data/audio/recording2.wav,Counsel objects to the characterization of the evidence
Supported Models
| Model Key | Hugging Face ID | Notes |
|---|---|---|
gemma-3n-e2b-it |
google/gemma-3n-E2B-it |
Default, ~2B instruct |
gemma-3n-e4b-it |
google/gemma-3n-E4B-it |
~4B instruct |
| `gemma- |
Установить gemma-tuner-multimodal в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл gemma-tuner-multimodal?
Fine-tune Gemma 4 and 3n models with audio, images, and text on Apple Silicon using PyTorch and Metal Performance Shaders.
Как установить скилл gemma-tuner-multimodal?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gemma-tuner-multimodal запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic