Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lonnen/constrained-logits-processors
not ready yet
https://github.com/lonnen/constrained-logits-processors
Last synced: about 1 month ago
JSON representation
not ready yet
- Host: GitHub
- URL: https://github.com/lonnen/constrained-logits-processors
- Owner: lonnen
- Created: 2023-04-21T07:46:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-28T01:09:39.000Z (6 months ago)
- Last Synced: 2024-05-28T11:17:06.476Z (6 months ago)
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
=============================
Constrained Logits Processors
=============================HuggingFace's `transformers library `_
has a number of logits processors useful for nudging the probability of certain
tokens appearing in text generation models.This module implements a logits processor that constrains logits for text generation
using a letter bank, similar to scrabble, by masking out tokens that cannot be spelled
with the remaining letters to `-math.Inf`. It doesn't work well and maybe it would be
better implemented as a `Constraint `.|Build Status|
.. |Build Status| image:: https://github.com/lonnen/constrained-logits-processors/actions/workflows/main.yml/badge.svg?branch=main
:target: https://github.com/lonnen/constrained-logits-processors/actions/workflows/main.yml:Code: https://github.com/lonnen/constrained-logits-processors
:Issues: https://github.com/lonnen/constrained-logits-processors/issues
:Releases: https://pypi.org/project/constrained-logits-processors/#history
:License: MIT; See LICENSEInstall
=======To get started, install the library with `pip `_:
.. code-block:: shell
$ pip install git+https://github.com/lonnen/constrained-logits-processors.git
Usage
=====.. code-block:: python
>>> from constrained_logits_processors import LetterBankLogitsProcessor
>>> # pass