book-sft-pipeline

Automate SFT dataset creation from ePub books and LoRA training.

Updated Jun 17, 2025
One-click install
npx skills add https://github.com/jax2730/workcode --skill book-sft-pipeline-jax2730
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: book-sft-pipeline
Source: https://github.com/jax2730/workcode/tree/main/LLM%26Dialog/Agent-Skills-for-Context-Engineering-main/examples/book-sft-pipeline
Command: npx skills add https://github.com/jax2730/workcode --skill book-sft-pipeline-jax2730

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill automates the complex process of fine-tuning language models to replicate specific authorial styles, transforming raw books into style-transfer models.

Core Features & Use Cases

  • End-to-End Pipeline: Guides users from book extraction (ePub) to dataset creation (JSONL) and LoRA training.
  • Intelligent Segmentation: Splits text into semantically coherent chunks (150-400 words) for optimal style learning.
  • Diverse Instruction Generation: Employs multiple prompt and system templates to prevent memorization and ensure genuine style transfer.
  • Use Case: Replicate the unique writing style of a favorite author, like Gertrude Stein, for creative writing assistance or stylistic analysis.

Quick Start

Use the book-sft-pipeline skill to fine-tune a model on the book 'Three Lives' by Gertrude Stein.

Frequently Asked Questions about book-sft-pipeline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fine-tune an LLM to write in a specific author's style?

To fine-tune an LLM for author style replication, you can automate the creation of Supervised Fine-Tuning datasets from books. This pipeline extracts ePub texts, segments them into coherent chunks, generates diverse instructions, and prepares JSONL data for LoRA training.

What is the best way to create an SFT dataset from a book for style transfer?

Creating an SFT dataset for style transfer involves extracting book text and splitting it into semantically coherent chunks of 150-400 words. The pipeline then uses LLM prompting with multiple templates to generate diverse instructions, preventing memorization and ensuring genuine style learning.

Can I train LLMs on ePub files using LoRA?

Yes, you can train LLMs on ePub files using LoRA. The pipeline handles text extraction from ePub formats, constructs a JSONL dataset, and runs LoRA training on platforms like Tinker, validating the results through modern scenario testing and originality checks.

How do I prevent my fine-tuned model from just memorizing the book text?

To prevent memorization during LLM training, the pipeline employs diverse instruction generation using multiple prompt and system templates. This approach ensures the model learns the author's style transfer rather than simply replicating the original text chunks.

Does this dataset generation pipeline support training platforms other than Tinker?

The pipeline explicitly supports LoRA training on platforms like Tinker. It outputs standard JSONL datasets, allowing integration with other LoRA training platforms that accept this format.