Skip to content

Feature/sft training data generator#52

Closed
Kacent123 wants to merge 2 commits intoScottcjn:mainfrom
Kacent123:feature/sft-training-data-generator
Closed

Feature/sft training data generator#52
Kacent123 wants to merge 2 commits intoScottcjn:mainfrom
Kacent123:feature/sft-training-data-generator

Conversation

@Kacent123
Copy link

Summary

Implements SFT training data generator for Issue #2.

Features

  • TrainingExample dataclass for ChatML-formatted training data
  • PersonalityTemplate class for template-driven personality definitions
  • SFTDataGenerator class with identity-weighted sampling
  • Support for TRL, OpenAI, and ChatML output formats
  • CLI command: shaprai generate-sft
  • Three example personality templates
  • 20 unit tests

Testing

All tests pass successfully.

Closes #2

Bounty: 50 RTC

Kacent 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
@Scottcjn
Copy link
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.

@Scottcjn Scottcjn closed this Mar 12, 2026
@Scottcjn
Copy link
Owner

Closing — bounties #2 (SFT) and #7/#8 (Sanctuary/Marketplace) were fulfilled by sarahdack854 who submitted first. Your Elyan Bus tests PR #53 is still open — please rebase on main to resolve conflicts and that 25 RTC bounty is yours.

@Scottcjn
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty: 50 RTC] Training data generator for SFT pipeline

2 participants