stylellm_models  by stylellm

Text style transfer via LLMs, mimicking literary works

Created 1 year ago
346 stars

Top 80.2% on SourcePulse

GitHubView on GitHub
Project Summary

StyleLLM provides a suite of large language models fine-tuned to mimic the distinct writing styles of classic Chinese literature, specifically the "Four Great Classical Novels." This project enables users to perform text style transfer, allowing them to rewrite general text in a chosen literary style for creative writing, content enhancement, or stylistic imitation.

How It Works

The project leverages the Yi-6b base model, fine-tuning it on the distinct linguistic patterns, vocabulary, sentence structures, and rhetorical devices found in Romance of the Three Kingdoms, Journey to the West, Water Margin, and Dream of the Red Chamber. This approach allows for the capture and replication of nuanced stylistic elements, offering a more authentic and targeted style transfer than generic LLM outputs. Quantized versions (AWQ, 4-bit) are available for reduced VRAM usage, though with a potential trade-off in stylistic fidelity.

Quick Start & Requirements

  • Installation: pip install autoawq (for AWQ quantized models).
  • Usage: Python script inference.py or direct Hugging Face transformers integration.
  • Prerequisites: Python, PyTorch, Hugging Face transformers, autoawq (for quantized models).
  • Hardware: AWQ quantized models require ~4.2GB VRAM. Full models will have higher requirements.
  • Demo: Colab notebook available for quick chat-style interaction.

Highlighted Details

  • Offers four distinct style models based on Romance of the Three Kingdoms, Journey to the West, Water Margin, and Dream of the Red Chamber.
  • Provides AWQ quantized versions for lower VRAM consumption.
  • Demonstrates style transfer capabilities with side-by-side comparisons of classic text rewrites.
  • Includes a "StyleLLM-Chat" component for stylistic modification of general LLM outputs.

Maintenance & Community

The project acknowledges its reliance on the 01-ai/Yi base model and the LLaMA-Factory training framework. Further community engagement details (Discord, Slack, etc.) are not explicitly provided in the README.

Licensing & Compatibility

The project's licensing is not explicitly stated in the README. Compatibility for commercial use or closed-source linking would require clarification of the underlying model and framework licenses.

Limitations & Caveats

Quantized models may exhibit a reduction in stylistic expression compared to their unquantized counterparts. The README does not detail specific performance benchmarks or potential limitations in capturing extremely subtle stylistic nuances.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.