--- id: stop-sequencer version: "1.2.3" license: unclear license_treatment: unclear maintenance: abandoned --- # stop-sequencer — Implementation of stop sequencer for Huggingface Transformers License: unclear · Maintenance: abandoned · Downloads: 77.6K/mo ## What it is and what it does Stop Sequencer is a wrapper that lets you stop text generation when the model produces a specified stop sequence. You register stop texts (like "Ryan:" or "Kevin:") before calling generate(), and the package attempts to halt output when those patterns appear. However, due to limitations in the underlying implementation, the stop sequence may still appear in the output—you must manually post-process the result to remove it completely. The package has no runtime dependencies. It works with both causal and seq2seq model types. The main trade-off is that it stops generation after the stop text appears, not before, so you need to strip the unwanted text from the result yourself. Use it for: - Dialogue generation where you want output to stop when a specific speaker's name appears - Conditional text generation that should terminate at natural boundaries marked by specific tokens or phrases - Multi-turn conversation simulation where each turn should end at a designated marker - Controlled generation tasks where output length is bounded by semantic stop conditions rather than token limits alone ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds stop-sequence support to Huggingface Transformers text generation, allowing you to halt output when specified text patterns appear. No. The package is abandoned (last commit 2023-06-06, no activity for 1165 days) and has a critical limitation: stop sequences still appear in output and require manual post-processing. License metadata is unclear. For modern workflows, investigate native alternatives in the underlying framework. ## Install pip install stop-sequencer uv add stop-sequencer poetry add stop-sequencer ## Installing stop-sequencer Before you install: High install friction with no runtime dependencies. Package is abandoned as of June 2023 with no commits since; last release was 1165 days ago. Maintenance risk is significant for a specialized transformer integration. License in practice: License treatment is unclear—the description excerpt shows Apache 2.0 text, but the metadata records no SPDX identifier and an empty license_raw field. Verify the actual license before use. Quickstart: pip install stop-sequencer from stop_sequencer import StopSequencer stop_sequencer = StopSequencer( model, model_type="causal", tokenizer=tokenizer, ) model = stop_sequencer.register_stop_texts( stop_texts=["Ryan:"], input_length=tokens.size(-1), ) outputs = model.generate(tokens, max_length=100) Post-processing of generated text is mandatory due to Transformers API limitations—stop sequences may appear in output and must be manually stripped. Verify before relying: - Whether the package works with current versions of transformers (last tested June 2023) - Compatibility with modern Huggingface Transformers API changes since abandonment - Whether Apache 2.0 license is the actual governing license despite metadata ambiguity ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: high - Maintenance: abandoned - Downloads: 77.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags stop sequence generation transformers, halt text generation at pattern, early stopping transformers, control generation termination, stop words text generation, generation stopping criteria, text-generation, abandoned [View on SkillFed](https://skillfed.io/packages/stop-sequencer) · [View on PyPI](https://pypi.org/project/stop-sequencer/)