Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outlines: Guided Text Generation #186

Open
1 task
irthomasthomas opened this issue Dec 30, 2023 · 0 comments
Open
1 task

outlines: Guided Text Generation #186

irthomasthomas opened this issue Dec 30, 2023 · 0 comments
Labels
llm Large Language Models llm-experiments experiments with large language models llm-function-calling Function Calling with Large Language Models llm-inference-engines Software to run inference on large language models

Comments

@irthomasthomas
Copy link
Owner

pip install outlines
First time here? Go to our setup guide

Features

🤖 Multiple model integrations: OpenAI, transformers, AutoGPTQ, AutoAWQ
🖍️ Simple and powerful prompting primitives based on the Jinja templating engine
🚄 Multiple choices, type constraints and dynamic stopping
⚡ Fast regex-guided generation
🔥 Fast JSON generation following a JSON schema or a Pydantic model
📝 Grammar-guided generation
🐍 Interleave completions with loops, conditionals, and custom Python functions
💾 Caching of generations
🗂️ Batch inference
🚀 Serve with vLLM
Outlines 〰 has new releases and features coming every week. Make sure to ⭐ star and 👀 watch this repository, follow @dottxtai to stay up to date!

Guided generation

The first step towards reliability of systems that include large language models is to ensure that there is a well-defined interface between their output and user-defined code. Outlines provides ways to control the generation of language models to make their output more predictable.

Multiple choices

You can reduce the completion to a choice between multiple possibilities:

import outlines

model = outlines.models.transformers("mistralai/Mistral-7B-v0.1")

prompt = """You are a sentiment-labelling assistant.
Is the following review positive or negative?

Review: This restaurant is just awesome!
"""
answer = outlines.generate.choice(model, ["Positive", "Negative"])(prompt)
Type constraint

@irthomasthomas irthomasthomas added inbox-url llm Large Language Models llm-experiments experiments with large language models unclassified Choose this if none of the other labels (bar New Label) fit the content. llm-function-calling Function Calling with Large Language Models llm-inference-engines Software to run inference on large language models and removed unclassified Choose this if none of the other labels (bar New Label) fit the content. labels Dec 30, 2023
@ShellLM ShellLM removed the llama label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llm Large Language Models llm-experiments experiments with large language models llm-function-calling Function Calling with Large Language Models llm-inference-engines Software to run inference on large language models
Projects
None yet
Development

No branches or pull requests

2 participants