Instructions to use Matrix-Corp/TouchGrass-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Matrix-Corp/TouchGrass-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Matrix-Corp/TouchGrass-3b")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Matrix-Corp/TouchGrass-3b", device_map="auto") - PEFT
How to use Matrix-Corp/TouchGrass-3b with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Matrix-Corp/TouchGrass-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Matrix-Corp/TouchGrass-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Matrix-Corp/TouchGrass-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Matrix-Corp/TouchGrass-3b
- SGLang
How to use Matrix-Corp/TouchGrass-3b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Matrix-Corp/TouchGrass-3b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Matrix-Corp/TouchGrass-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Matrix-Corp/TouchGrass-3b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Matrix-Corp/TouchGrass-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Matrix-Corp/TouchGrass-3b with Docker Model Runner:
docker model run hf.co/Matrix-Corp/TouchGrass-3b
Download modelcard.md from Matrix-Corp/TouchGrass-3b: direct link, hf CLI and curl.
- Browser
- Download file 6.89 kB
-
https://huggingface.co/Matrix-Corp/TouchGrass-3b/resolve/main/modelcard.md
- Command line
-
hf download hf://Matrix-Corp/TouchGrass-3b/modelcard.md
-
curl -L -o modelcard.md https://huggingface.co/Matrix-Corp/TouchGrass-3b/resolve/main/modelcard.md
license: apache-2.0
tags:
- music
- text-generation
- instruction-tuning
- lora
- preview
- untrained
- qwen3.5
- touchgrass
datasets:
- synthetic
language:
- en
library_name: transformers
pipeline_tag: text-generation
TouchGrass-3B π΅
Status: PREVIEW - UNTRAINED MODEL
This is a preview repository for TouchGrass-3B, a lightweight music AI assistant fine-tuned from Qwen3.-3B-Instruct. This model has NOT been trained yet - it contains randomly initialized LoRA adapters and is not ready for inference.
β οΈ Important Notice
- Model is UNTRAINED: The LoRA adapters are randomly initialized. Performance will be no better than the base Qwen3.5-3B-Instruct model.
- For demonstration purposes only: This repository contains the complete codebase and configuration for training the model.
- Expected performance after training: 94-95% accuracy on music-specific tasks (based on architecture design and synthetic data pipeline).
π― Model Overview
TouchGrass is a specialized music AI assistant built by fine-tuning Qwen3.5 models with:
- Music Tokenizer Extension: 21+ music-specific tokens (guitar, piano, drums, vocals, theory, DJ, tablature, chords, etc.)
- Five Specialized Modules:
- πΈ Tab & Chord Generation (guitar tabs, chord diagrams)
- πΉ Music Theory Engine (scales, intervals, progressions)
- π Ear Training (interval ID, solfege exercises)
- π EQ Adapter (frustration detection, emotional adaptation)
- βοΈ Song Writing Assistant (progressions, lyrics, hooks)
- LoRA Fine-Tuning: Efficient parameter-efficient fine-tuning
- Multi-Task Learning: Weighted losses (LM: 1.0, EQ: 0.1, Music: 0.05)
π Model Details
| Property | Value |
|---|---|
| Base Model | Qwen/Qwen3.5-3B-Instruct |
| Model Size | ~3.5B parameters (with LoRA) |
| Vocab Size | 32,000 (Qwen3.5 + music tokens) |
| Max Sequence Length | 4,096 tokens |
| LoRA Rank | 16 (configurable) |
| Training Data | Synthetic music QA (10 categories, 80+ templates) |
| Training Steps | 50,000 (planned) |
| Batch Size | 8-16 (depending on GPU) |
| Learning Rate | 2e-4 (with warmup) |
ποΈ Architecture
The model extends Qwen3.5 with:
- Custom tokenizer with music domain tokens
- Five LoRA-adapted modules inserted at transformer layers
- Multi-task heads for music-specific predictions
- Emotional intelligence via EQ adapter
π Usage (After Training)
HuggingFace Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
from TouchGrass.configuration_touchgrass import TouchGrassConfig
from TouchGrass.tokenization_touchgrass import TouchGrassTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained("your-username/TouchGrass-3B")
tokenizer = TouchGrassTokenizer.from_pretrained("your-username/TouchGrass-3B")
# Generate with instrument context
prompt = "[GUITAR][BEGINNER] How do I play an F major chord?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0]))
Ollama (After Training)
# Create Modelfile (provided in repository)
ollama create touchgrass-3b -f ollama_3b_modelfile
# Run inference
ollama run touchgrass-3b "How do I build a chord progression in C major?"
π Repository Structure
This repository contains all necessary files for training:
touchgrass-3b/
βββ configuration_touchgrass.py # HuggingFace config class
βββ tokenization_touchgrass.py # HuggingFace tokenizer wrapper
βββ train.py # Main training script
βββ configs/
β βββ touchgrass_3b_config.py # Model architecture config
β βββ touchgrass_7b_config.py # 7B config (for reference)
β βββ training_config.py # Training hyperparameters
βββ tokenizer/
β βββ music_token_extension.py # Music token definitions
βββ models/ # Five specialized modules
β βββ tab_chord_module.py
β βββ music_theory_module.py
β βββ ear_training_module.py
β βββ eq_adapter.py
β βββ songwriting_module.py
βββ data/ # Data pipeline
β βββ music_qa_generator.py
β βββ chat_formatter.py
β βββ dataset_loader.py
βββ training/
β βββ losses.py
β βββ trainer.py
β βββ train.py
βββ inference/
β βββ inference.py
βββ benchmarks/
β βββ evaluate_music_modules.py
β βββ evaluate_inference.py
βββ tests/ # Comprehensive test suite
βββ ollama_3b_modelfile # Ollama configuration
βββ README.md # Full documentation
βββ PREVIEW_README.md # This preview notice
π§ͺ Testing
Run the test suite:
cd touchgrass-3b
python -m pytest tests/ -v
π Documentation
See README.md for complete documentation including:
- Installation instructions
- Training guide
- Inference examples
- Module specifications
- Data generation details
- Troubleshooting
βοΈ Training (When Resources Available)
- Generate synthetic data:
python -c "from data.music_qa_generator import MusicQAGenerator; MusicQAGenerator().generate_dataset(num_samples=10000, output_path='data/music_qa.jsonl')"
- Start training:
python train.py --config configs/touchgrass_3b_config.py --data data/music_qa.jsonl --output_dir ./checkpoints
- Convert to HuggingFace format:
python -c "from configuration_touchgrass import TouchGrassConfig; from tokenization_touchgrass import TouchGrassTokenizer; config = TouchGrassConfig.from_pretrained('./checkpoints'); tokenizer = TouchGrassTokenizer.from_pretrained('./checkpoints'); config.save_pretrained('./model'); tokenizer.save_pretrained('./model')"
- Push to HuggingFace:
huggingface-cli login
huggingface-cli upload your-username/TouchGrass-3B ./model --repo-type model
π€ Contributing
This is a preview. Contributions welcome for:
- Improving synthetic data quality
- Adding more music categories
- Optimizing training efficiency
- Extending to more instruments
π License
Apache 2.0
π Acknowledgments
- Built upon Qwen3.5 by Alibaba Cloud
- Inspired by the need for accessible music education AI
- Special thanks to the open-source music technology community
β οΈ REMINDER: This is an UNTRAINED PREVIEW model. Do not use for production inference without completing the training process.