rewriter / README.md
kalcy0n's picture
Archive pinned checkpoint and role protocol
48b5dbf verified
|
Raw History Blame Contribute Delete
2.97 kB
metadata
license: apache-2.0
base_model: unsloth/Qwen3-4B-Instruct-2507-unsloth-bnb-4bit
library_name: transformers
pipeline_tag: text-generation
tags:
  - text-editing
  - bitsandbytes

Source-grounded passage humanizer

This checkpoint uses Qwen3-4B-Instruct-2507 with Unsloth's NF4 quantization. The writer takes one prose passage, decides whether it needs a repair, and selects the span to edit. A source-derived brief records the genre, purpose, takeaway, and relationships the edit should preserve. The writer proposes a replacement within that span and compares the result against the original for changes in meaning.

The published weights are the unadapted model from upstream revision 7744afa8566e264af1a92a806d8d9aae00cc7c78. The editing behavior is provided by the prompts, schemas and span renderer in writer.py. base-lock.json identifies the exact files for restoring the weights and tokenizer. Quantized checkpoint · Original Qwen model

Use

From a complete downloaded snapshot, use Python 3.11+ with PyTorch, Transformers, Accelerate, bitsandbytes, lm-format-enforcer and a CUDA GPU supporting native BF16. Supply UTF-8 JSON with an original field on standard input.

printf '%s\n' '{"original":"The two copies was legible."}' | python writer.py run

KEEP retains a passage the planner judged sound. UNCHANGED records a proposal that reproduced the source verbatim. REJECTED records a candidate that failed the meaning check. REVIEW returns both original and candidate for independent review. The full experiment also applies surface and logical-operator checks, bidirectional entailment and an independent repair judge before delivering an edit. This portable entry point stops at the candidate stage. Truncated or malformed generations raise an error.

For a review service, the standard-library messages command exposes the exact messages for each stage. plan and brief take the original passage. replace also takes a validated EDIT plan and an optional brief. semantic takes the original and the candidate. Schema-bearing stages return their JSON schema with the prompt.

printf '%s\n' '{"original":"The two copies was legible."}' | python writer.py messages plan

Measured limitations

On nine synthetic development passages, the guarded pipeline delivered the original passage for all nine. It preserved all three deliberately structured passages and completed zero of five required repairs. Missed edits included actor attribution, ordering an exception before a general instruction, and subject–verb agreement. No distinct delivered rewrites were available to measure author style. Larger or different passages require separate evaluation.

The checkpoint's upstream Apache 2.0 license is included in LICENSE.