Sign up to save tools and stay up to date with the latest in AI
bg
bg
1

GitHub - normal-computing/outlines: Generative Model Programming

Aug 14, 2023 - github.com
Outlines is a library for neural text generation that offers a more flexible alternative to the 'generate' method in the transformers library. It assists developers in guiding text generation to build robust interfaces with external systems, providing generation methods that ensure the output will match regular expressions or follow a JSON schema. Outlines also offers robust prompting primitives that separate the prompting from the execution logic, leading to simple implementations of few-shot generations, ReAct, meta-prompting, agents, and more. It is designed to be compatible with the broader ecosystem and can be used with all models.

The library features simple and powerful prompting primitives based on the Jinja templating engine, guided generation, fast regex-guided generation, fast JSON generation following a JSON schema or a Pydantic model, and integration with HuggingFace's 'transformers' models. It also allows for the interleaving of completions with loops, conditionals, and custom Python functions, and offers caching of generations. Outlines is available on PyPi and has new releases and features coming every week.

Key takeaways:

  • Outlines is a library for neural text generation, designed to be flexible and compatible with all models, providing robust prompting primitives and guided text generation.
  • It offers features like simple and powerful prompting primitives, guided generation, fast regex-guided generation, fast JSON generation following a JSON schema or a Pydantic model, and integration with HuggingFace's transformers models.
  • Outlines allows developers to control the generation of language models to make their output more predictable, with methods like early stopping, multiple choices, type constraint, and efficient regex-guided generation.
  • It also provides efficient JSON generation following a Pydantic model, allowing the generation process to be guided so the output is guaranteed to follow a JSON schema or Pydantic model.
View Full Article

Comments (0)

Be the first to comment!