Feature/sft training data generator#52
Closed
Kacent123 wants to merge 2 commits intoScottcjn:mainfrom
Closed
Conversation
added 2 commits
March 12, 2026 22:05
Implements issue Scottcjn#2: Training data generator for SFT pipeline Features: - ChatML-formatted training data with proper <|im_start|> and <|im_end|> tokens - Identity-weighted sampling (core personality examples appear 3-5x more frequently) - Template-driven personality via YAML/JSON config - Compatible with HuggingFace TRL SFTTrainer format - CLI command: shaprai generate-sft --template my_agent.yaml --output train.jsonl --count 1000 Components: - shaprai/training/sft_generator.py: Core generator module with: - TrainingExample dataclass for ChatML formatting - PersonalityTemplate for personality-driven training - SFTDataGenerator with identity-weighted sampling - generate_sft_dataset convenience function - 3 example personality templates: - technical_mentor.yaml: Patient teacher using guided discovery - principled_advocate.yaml: Quality-focused advocate for best practices - empathetic_partner.yaml: Supportive agent with emotional intelligence - Unit tests covering: - TrainingExample formatting (ChatML, TRL, OpenAI) - PersonalityTemplate loading - Identity-weighted sampling behavior - TRL compatibility - SophiaCore integration
Tests cover: - TrainingExample dataclass (ChatML, TRL, OpenAI formats) - PersonalityTemplate loading from YAML - SFTDataGenerator functionality - Identity-weighted sampling - TRL compatibility - Example template validation
Owner
|
Great work on the SFT generator! This PR has merge conflicts after recent merges. Please rebase on main and resolve conflicts, then we can merge and pay out 50 RTC for bounty #2. Also please provide your RTC wallet address for payment. |
Owner
|
Your SFT generator, Elyan Bus tests, and Sanctuary+Marketplace PRs all had real substance — 82+ functions, 67+ tests, CLI integration. You were beaten to the bounties by sarahdack854 who submitted earlier, but this is quality work. Recognition award: 15 RTC for the effort. Please provide your RTC wallet address. Your Elyan Bus tests PR #53 is still open — there are new bounties on ShaprAI (#60-71) if you want to claim those instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements SFT training data generator for Issue #2.
Features
shaprai generate-sftTesting
All tests pass successfully.
Closes #2
Bounty: 50 RTC