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

merge upstream #2

Open
wants to merge 288 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
288 commits
Select commit Hold shift + click to select a range
f2af45a
Add documentation vLLM for multiple GPUs
rlouf Apr 15, 2024
98dd9dd
Add `torch` dependency in installation instructions
rlouf Apr 15, 2024
0bb6d1d
Add DirectMerge article
rlouf Apr 15, 2024
895a82e
Add cookbook to run Outlines on Modal
rlouf Apr 11, 2024
f6e5523
Make `torch` import optional
rlouf Apr 16, 2024
2182dbc
Add Outlines twitter account
rlouf Apr 16, 2024
06d5654
Exclude escape character in JSON string fields
rlouf Apr 20, 2024
8208133
Add tweets about Outlines
rlouf Apr 18, 2024
92d79a1
#824 model_name as optional parameter for azure_openai
Apr 18, 2024
d548d92
Force dates, uuid, datetimes, times to be between quotes
navster888 Apr 13, 2024
4d6ec1f
Remove unnecessary vocabulary copies in `RegexGuide`
rlouf Apr 20, 2024
19eb0f0
Fix typo in llama.cpp documentation
rlouf Apr 24, 2024
fc5e342
add azure_openai to models __init__.py
lassiraa Apr 26, 2024
078f822
follow isort
lassiraa Apr 26, 2024
1eb9a04
Add phone number and zip code custom types
rlouf Apr 30, 2024
9188eff
Add cookbook to run Outlines with BentoML and BentoCloud
larme Apr 25, 2024
f5c43e0
Add Gigax project to community
rlouf Apr 30, 2024
4934425
Add HF evaluation article
rlouf Apr 30, 2024
164d1f0
Remove the need to copy all tokens during basic generation
brandonwillard Apr 30, 2024
d6a2b79
Add HF article to README
rlouf May 2, 2024
ec664fe
Add ISBN type
rlouf May 2, 2024
1053e7d
Add IATA code type
rlouf May 2, 2024
51064f3
Add country types
rlouf May 2, 2024
842ef19
Fix typo in docs (#860)
eitanturok May 3, 2024
a101c1c
Update README.md
rlouf May 3, 2024
b3b29fe
Fix code rendering (#864)
eitanturok May 5, 2024
db83c08
ignore import warnings from huggingface_hub & pyairports
leloykun May 5, 2024
b7d876e
Fix format in the BentoML doc
Sherlock113 May 6, 2024
353cebb
fix CFG Generation
leloykun May 5, 2024
4f8433d
Localize types
rlouf May 6, 2024
a84d78c
Add `Email` type (#870)
eitanturok May 8, 2024
99e684e
Fix installation instructions (#877)
eitanturok May 8, 2024
97ec37d
Extract function name in `get_schema_from_signature` (#878)
eitanturok May 8, 2024
78852b0
Remove broken final state loop (#874)
br3no May 11, 2024
159d1ec
Fixing stream stopping at wrong location (#898)
isamu-isozaki May 17, 2024
499d19d
Prevent Illegal Look-Around for OneOf in JSONSchema (#897)
lapp0 May 17, 2024
315d531
circumvent broken llama.cpp pre-tokenizer
lapp0 May 17, 2024
3e291b1
Add args to Jinja filters (#902)
eitanturok May 17, 2024
7863f8e
Allow Parenthesis in `STRING_INNER` (#899)
lapp0 May 18, 2024
6f655ca
Allow objects in json schemas without additionalProperties set
lapp0 May 21, 2024
ffab2ac
Use TQDM to track index compilation progress
lapp0 May 23, 2024
d7c9707
Refactor cache decorator
brandonwillard May 22, 2024
ba7affd
Use a persistent Tokenizer hash for create_states_mapping cache
brandonwillard May 21, 2024
411eaaf
Use less problematic whitespace token (#916)
lapp0 May 24, 2024
e5c39e2
Enable Tuples / prefixItems in build_regex_from_schema()
lapp0 May 22, 2024
538f77a
Fix invalid regex in unconstrained arrays for json_schema.py
lapp0 May 25, 2024
7723ce8
allow json schema of {}, resulting in unconstrained json value
lapp0 May 30, 2024
6696cb5
Fix llamacpp caching by making LlamaCppTokenizer pickleable
lapp0 May 29, 2024
3a7d83b
make LlamaCppTokenizer an outlines Tokenizer
lapp0 May 31, 2024
7e58226
Verify Wheel Build and SDist Test in PR Tests Workflow
lapp0 Jun 1, 2024
81354c8
add pycountry and pyairports to required dependencies
lapp0 Jun 1, 2024
95f108e
Set up Python step in PyPi Release workflow
lapp0 Jun 1, 2024
3029b28
ASV PR bench workflow, pytest-bench -> ASV, add peakmem tests
lapp0 May 31, 2024
6fe76d5
ensure workflow fails if benchmark degredation >10%
lapp0 Jun 1, 2024
9b2b923
disable outlines cache localized to the benchmarks scope
lapp0 Jun 4, 2024
b5a2073
use outlines-dev/outlines for asv.conf.json show_commit_url
lapp0 Jun 4, 2024
9780992
Add Documentation on Outlines Versioning and Releases
lapp0 Jun 3, 2024
0b4d12b
add versioning guide to community tab
lapp0 Jun 4, 2024
b8d58da
Fix null byte `\x00` issue by switching to `numba.types.unicode_type`
M0gician May 19, 2024
869235f
ensure byte fsm unicode_type compatibility by prefixing hex-bytes wit…
lapp0 May 26, 2024
ee34e8e
index token -> transition key sequence for efficient _walk_fsm
lapp0 May 30, 2024
aac4b3e
pass token_transition_sequence to walk_fsm in parsing.py
lapp0 May 31, 2024
3b66f45
add assertions for numba behavior re: UnicodeCharSeq / unicode_type
lapp0 Jun 4, 2024
8a6b7dc
Add docstrings to get_token/vocab_transition_keys, improve naming
lapp0 Jun 4, 2024
c11a595
remove cleanup step redundant with cleanup_lark_import
lapp0 Jun 4, 2024
ed44a47
Improve naming of token and vocab transition keys in regex.py
lapp0 Jun 4, 2024
80121d6
Correct link for llamacpp library
alonsosilvaallende Jun 10, 2024
aa148cf
Add statement regarding OS vs closed models
rlouf Jun 10, 2024
11af6ce
Support min/max number of digits for numbers in JSON Schema (#932)
smagnan Jun 11, 2024
a987159
Fix/extend re replacement seq (#948)
saattrupdan Jun 12, 2024
1bdcaa5
Update docker ENTRYPOINT to ensure proper argument handling (#962)
shashankmangla Jun 13, 2024
1948f0f
Add cerebrium as deployment option in documentation
milo157 Jun 12, 2024
742eb89
Add link to TGI documentation
rlouf Jun 13, 2024
18aaba1
add outlines.models.mlxlm
lapp0 Jun 13, 2024
ed8e6ec
Allow to pass all `AsyncOpenai` client parameters
rlouf Jun 10, 2024
320af22
Update the doc for OpenAI models
rlouf Jun 10, 2024
502bfdd
fix dependency issues
fpgmaas Jun 11, 2024
61d1f43
Update Modal refs from stub to app
kstathou Jun 15, 2024
0c1935a
Mask cache Performance Optimization for vllm (#939)
paul-grundmann Jun 16, 2024
49146d5
update README.md (#968)
silviachen46 Jun 16, 2024
6a2e6af
Pin Numpy to Prevent Use of Breaking Version
lapp0 Jun 16, 2024
26142d5
Adding MLXLM, VLLM class to LogitsGenerator type
parkervg Jun 14, 2024
63ac124
Fix samplers documentation (#980)
jrinder42 Jun 18, 2024
7d8269f
Ensure regex matches valid JSON for "const" and "enum" with booleans,…
mwootten Jun 14, 2024
7b8caee
Add link to docs of Multimodal Structured Generation for CVPR 2nd MMF…
leloykun Jun 19, 2024
371313e
fix HF Hub ID
davanstrien Jun 19, 2024
a9d58ef
Allow escaped strings in json_schema.py
lapp0 Jun 20, 2024
f20c774
Fix use of `os.environ` in documentation
rshah713 Jun 19, 2024
60e89f5
fix pattern-string in json_schema.py by removing anchors
lapp0 Jun 21, 2024
8dcd24e
fix models.llamacpp vocabulary normalization function
lapp0 Jun 21, 2024
7934b31
Add contributors, creation and update date
rlouf Jun 22, 2024
7d594a1
Add SimToM prompt recipe (#1002)
kstathou Jun 23, 2024
42206e2
Ensure no implicit max_tokens in models.llamacpp
lapp0 Jun 23, 2024
1bc2a30
fix models.mlxlm whitespace prefix handling
lapp0 Jun 23, 2024
f7d525b
Adding the option to avoid displaying tqdm bars at inference with `vl…
BIMM99 Jun 24, 2024
8406f44
Update , enable requirement only on darwin, disable requirement on …
lapp0 Jun 25, 2024
2807dca
Add asknews example (#1008)
robcaulk Jun 28, 2024
a643cb0
Improve `outlines.processors`, add integration tests to test_generate…
lapp0 Jun 30, 2024
833f68f
Add abridged version of the .txt article on Coding For Structured Gen…
willkurt Jul 1, 2024
25b6bcd
Cache Legal-Token Mask as torch.tensor
lapp0 Jul 2, 2024
ea5fbdb
fix json prompt example
rshah713 Jul 10, 2024
497ed9f
Fix broken link in README.md regarding Serving with vLLM
shinohara-rin Jul 11, 2024
0383ce1
Fix bug in batched multi sample generation
JulesGM Jul 8, 2024
8c5f1d8
Fixed __call__ as well
JulesGM Jul 8, 2024
b54a964
Update outlines/generate/api.py
JulesGM Jul 8, 2024
59d88dc
Update file contributors style for docs
gtsiolis Jul 12, 2024
a48f86f
Add missing blank space (#1036)
talboren Jul 13, 2024
62b7601
Adds support for custom regex parsers (for multimodal structured gene…
leloykun Jul 14, 2024
8224855
Use LogitsProcessors for models.transformers, apply in outlines.gener…
lapp0 Jul 1, 2024
517ff53
Use LogitsProcessors for models.transformers -> outlines.generate.*
lapp0 Jun 21, 2024
5a7f082
enable generate.fsm with llamacpp by using outlines.processors
lapp0 Jul 15, 2024
08a3e54
Add QA with Citations example to the Cookbook (#1042)
alonsosilvaallende Jul 16, 2024
e684af2
Fix mamba integration by making it a variant of outlines.models.trans…
lapp0 Jul 16, 2024
cd8c79a
fix PyPI name for autoawq
davanstrien Jul 16, 2024
d64bfc2
add fallback tokenizer (#1046)
JerryKwan Jul 17, 2024
9ce0df3
Update cerebrium instructions
milo157 Jul 17, 2024
1bf23be
Add Knowledge Graph Extraction example
alonsosilvaallende Jul 18, 2024
f6a6c29
Correct link and add llama-cpp-python installation instructions (#1051)
alonsosilvaallende Jul 18, 2024
a7e3381
Introduce `outlines.models.transformers_vision` (#1052)
lapp0 Jul 19, 2024
47dfa4b
Use outlines.processors for vLLM
lapp0 Jul 20, 2024
42c55bc
Fix deprecated memory= parameter (#1057)
Perdu Jul 20, 2024
abe689c
Fix failing Modal example (#1058)
Perdu Jul 20, 2024
fcfef33
Add links to the two examples (#1062)
alonsosilvaallende Jul 22, 2024
d78041e
add link to MMSG
leloykun Jul 23, 2024
6e026a7
Correct documentation to disable caching
alonsosilvaallende Jul 27, 2024
bb92745
fix pad token id reset
ispobock Jul 27, 2024
26e2934
Fix link to `mamba` model reference
rlouf Jul 29, 2024
951b020
More detailed mlxlm documentation
lapp0 Jul 29, 2024
e3247fe
Add chain of thought example
alonsosilvaallende Aug 8, 2024
2a2a5d3
Fix typos
alonsosilvaallende Aug 8, 2024
2d1a06d
Fix coverage exclude_lines setting for ellipsis
brandonwillard Aug 8, 2024
5e8f770
Add ReAct agent example
alonsosilvaallende Aug 10, 2024
3072b8f
Include SPDX license info in project metadata
tiran Aug 13, 2024
d0be920
Restructure documentation, use phi-3-mini, include structured generat…
lapp0 Jul 22, 2024
b10c78f
don't use gated models (mistral) in outlines-supported documentation
lapp0 Jul 27, 2024
7218cdd
Add Remi's AI Engineer World’s Fair Presentation
lapp0 Jul 27, 2024
0c9f5bb
Make `model_class` required arg, default `processor_class` to `AutoPr…
parkervg Jul 31, 2024
a2dddea
Running pre-commit hooks
parkervg Jul 31, 2024
c6dd805
Pass `model_class` to transformers_vision in test_generate.py
parkervg Jul 31, 2024
c5a1788
Add types-Pillow to mypy hook
parkervg Jul 31, 2024
eca98a8
Add CPU-based test for transformers_vision models
parkervg Jul 31, 2024
894f240
Adding `apply_chat_template` argument to VisionSequenceGeneratorAdapter
parkervg Aug 1, 2024
3a98e44
More comprehensive TransformersVision test cases
parkervg Aug 1, 2024
a363568
Revert "Adding `apply_chat_template` argument to VisionSequenceGenera…
parkervg Aug 1, 2024
c2d92b7
Remove `apply_chat_template` test
parkervg Aug 1, 2024
90e588c
Fix details in the documentation
rlouf Aug 13, 2024
ce49ccd
Change cookbook examples: Download model weights in the hub cache fol…
alonsosilvaallende Aug 13, 2024
8e94488
Correct variable name in chain-of-thought example
cpfiffer Aug 14, 2024
e3ecbcc
Remove unused `llama.cpp` and `transformers` integrations
rlouf Jul 22, 2024
03b61c5
Move BaseModel conversion to `outlines.fsm`
rlouf Jul 22, 2024
0a70c42
Move function that adapts the tokenizer
rlouf Jul 22, 2024
900762b
Use relative coverage source paths
brandonwillard Aug 23, 2024
ce029a8
Add missing CI matrix step and use dev installs
brandonwillard Aug 28, 2024
067aedb
Update modal example (#1111)
cpfiffer Aug 29, 2024
7cf63d6
Fix typo (#1120)
billmetangmo Aug 29, 2024
18eafb0
pass text and images as kwargs to VLM processor
lapp0 Aug 30, 2024
f941fc7
Update CFGGuide to use outlines.fsm.parsing. Enable generate.cfg
lapp0 Jul 27, 2024
6fb3559
Add experimental-warning to CFGGuide, update warning-linked docs
lapp0 Jul 27, 2024
72377db
Add benchmark: CFG rejection sampling + CFG no rejection sampling
lapp0 Jul 27, 2024
8730325
Include hidden files in coverage CI upload
brandonwillard Sep 6, 2024
c3a1adf
Update artifact actions
brandonwillard Sep 6, 2024
e28d423
Add documentation request issue template (#1138)
cpfiffer Sep 10, 2024
d11048b
Set tokenizer versions in tests
brandonwillard Sep 10, 2024
ae1524c
Change Outlines' logo
rlouf Sep 11, 2024
4ee4203
Update logo size in documentation
rlouf Sep 12, 2024
ba8a52b
Improve sampler docs (#1141)
cpfiffer Sep 12, 2024
2a4d72d
Update vllm.md (#1137)
americanthinker Sep 12, 2024
0b9a3f1
Correct pathways, update site color, front page fixes (#1146)
cpfiffer Sep 13, 2024
cfde8b7
Change the color of the logo (#1155)
rlouf Sep 16, 2024
1894fa3
Remove Broken pyairports Package, Replace with airportsdata
lapp0 Sep 16, 2024
2b1aed0
enable actual-byte tokens in reduced_vocabulary
lapp0 Sep 14, 2024
5591950
Use OpenAI API For Structured Generation (json, choice)
lapp0 Sep 15, 2024
289ef5d
reflect in docs: models.openai with new interface, also remove refere…
lapp0 Sep 15, 2024
e07f550
Remove link to Outlines twitter account
rlouf Sep 21, 2024
77c6d67
Don't re-use logits processors in SequenceGeneratorAdapter, copy them
lapp0 Sep 17, 2024
538e714
Fix benchmark workflow triggers
brandonwillard Sep 23, 2024
6035e86
Reuse jinja environment for a prompt
jantrienes Sep 19, 2024
30531e5
Use more performant fsm backend
lapp0 Sep 27, 2024
c5be3b8
Pin outlines-core version
brandonwillard Oct 1, 2024
4bf1470
add missing comma in llamacpp docs
cpfiffer Oct 3, 2024
80b82f1
Exllamav2_filter
isamu-isozaki Jun 29, 2024
faa7c5c
automatically download exl2 model in tests
lapp0 Oct 4, 2024
0da7039
document third party exllamav2 with logits processor
lapp0 Oct 5, 2024
ef4e819
Version the Documentation
lapp0 Jul 21, 2024
541a8b0
update logits in place for GuideLogitsProcessor
lapp0 Oct 5, 2024
d1b8728
construct logits mask in batch operation
lapp0 Oct 5, 2024
9e8bd6c
ensure valid link to docs with latest/ in url
lapp0 Oct 7, 2024
a2fd35c
use not in mkdocs
lapp0 Oct 7, 2024
c1fae8a
Create lmstudio.md
cpfiffer Oct 10, 2024
64fb30f
use pre-commit
cpfiffer Oct 15, 2024
866b9a3
recover fsm_union, get_sub_fsms_from_seq, walk_fsm. Add to fsm/parser.py
lapp0 Oct 10, 2024
eabca69
update dependencies: torch is required, pin outlines-core==0.1.14
lapp0 Oct 10, 2024
6f36b71
update RegexGuide to conform with outlines-core
lapp0 Oct 11, 2024
969887e
test fsm_union and walk_fsm
lapp0 Oct 14, 2024
6cff654
Fix logo color and doc links (#1213)
cpfiffer Oct 18, 2024
a2fa1e0
Add transformers vision cookbook with atomic caption flow (#1216)
fearnworks Oct 21, 2024
dc31b9b
Update llamacpp.md (#1231)
eltociear Oct 27, 2024
5f39ded
Earnings report cookbook (#1235)
cpfiffer Nov 6, 2024
906e84e
Add PDF cookbook (#1256)
cpfiffer Nov 8, 2024
b93f550
Add earnings reports to cookbook index (#1255)
cpfiffer Nov 8, 2024
b5d26c4
Add a receipt processing cookbook (#1249)
cpfiffer Nov 8, 2024
d842522
Update README.md (#1258)
scampion Nov 10, 2024
c406da8
Bump to outlines-core=0.1.17 for python 3.12-3.13 support (#1273)
mgoin Nov 18, 2024
2eab80c
Turn off guide caching
torymur Nov 21, 2024
f099f96
Fix index interface in tests
torymur Nov 21, 2024
b55d314
Update generation.md
djinnome Nov 7, 2024
bf62d11
Add link to YT channel and .txt blog
rlouf Nov 27, 2024
7a9baad
Update home page spacing
gtsiolis Nov 27, 2024
63b4feb
Add compatibility for numpy 2 while preserving numpy 1 compatibility
neilmehta24 Nov 12, 2024
7cdaeac
Update `mlx-lm` kvcache creation
cmcmaster1 Nov 11, 2024
2db34c5
Add `beam` deployment example
mernit Oct 24, 2024
66f6627
Add OpenAI to LogitsGenerator
ulfaslak Sep 28, 2024
568f252
Add cookbook recipe to extract event details from text (#1269)
scampion Nov 27, 2024
5608dd8
Add jax compatible api (#1207)
sky-2002 Nov 27, 2024
e9485cf
Add json call with multi-function enums (#1277)
g-prz Nov 27, 2024
36f1bf2
Fix library top-level imports (#1296)
rlouf Nov 28, 2024
c8e69c6
Bump the outlines core version to 0.1.20
rlouf Dec 6, 2024
dccaace
Fix typo in vllm extra requirements
chicham Dec 3, 2024
e4f96fb
Handle enum in choice (#1279)
g-prz Dec 8, 2024
1b7ec18
Use `outlines-core` to translate JSON Schemas into regexes
rlouf Dec 2, 2024
5113f94
Convert `enum` of objects to `oneOf` with consts
rlouf Dec 9, 2024
147b03e
Fail as soon as one test fails
rlouf Dec 9, 2024
fb43f4f
Fix conversion from MLX to torch tensor
rlouf Dec 9, 2024
9df3b1b
Bump outlines-core to 0.1.24
rlouf Dec 9, 2024
05bcb4b
Bump `outlines-core` version to 0.1.25
rlouf Dec 11, 2024
5c41fb3
Bump outlines-core version to 0.1.26
sidharthrajaram Dec 13, 2024
365b566
Fix image link in receipt-digitization example
rootAvish Dec 16, 2024
9b586db
Move generation of sampling params (#1340)
sky-2002 Dec 16, 2024
061f2ba
Fix unresolved imports in transformers doc
TimZaman Dec 19, 2024
9744f00
Set docs `docstring_style` (#1343)
EdAbati Dec 21, 2024
6205c0b
Fix JSON structured import
denadai2 Dec 28, 2024
fef70c0
Update mkdocs.yml: jump to mamba section
martin0258 Dec 30, 2024
5920870
Update transformers.md: fix headings level for mkdocs toc
martin0258 Dec 30, 2024
fddfc8f
remove non_blocking=True
hoesler Nov 28, 2024
2f0740e
optimize tensor creation
hoesler Dec 5, 2024
6a8612b
add mps to processor benchmark
hoesler Dec 5, 2024
d32dfde
Skip `vllm`-related tests on non-linux platforms
yvan-sraka Jan 2, 2025
3cc399d
Fix `json_schema` imports in cot example
tylerjthomas9 Jan 4, 2025
4456f3c
Add `from_file` class method to the `Prompt` object
yvan-sraka Jan 9, 2025
bf27c77
Remove `prompt.render` method
yvan-sraka Jan 9, 2025
7149a5e
Apply a small fix suggested by linter: Ruff E721
yvan-sraka Jan 9, 2025
e7be562
Update react_agent.md with current import structure
pervrosen Jan 11, 2025
03d3878
Update transformers_vision.md
gante Jan 9, 2025
3af1e5a
Fix `vllm`-related pytest warning (that was spaming user)
yvan-sraka Jan 6, 2025
79100b2
Add filters to prompt function (#1371)
derfred Jan 14, 2025
a03c254
Remove incorrect text from feature matrix docs
cpfiffer Jan 14, 2025
7b9012b
Update vllm_integration.py to the latest version of outlines (#1352)
denadai2 Jan 15, 2025
088f439
[Preserve dtype of array when converting to torch (#1349)
neilmehta24 Jan 15, 2025
8b173a3
Fix typo in docs/community/examples
petros Jan 16, 2025
063291d
Fix readme to reflect routing through enum
farnasirim Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
contact_links:
- name: 🤔 Questions & Help
url: https://github.com/outlines-dev/outlines/discussions/new
url: https://github.com/dottxt-ai/outlines/discussions/new
about: "If you have a question about how to use Outlines, please start a discussion."
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/doc_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: 📚 Documentation
about: Help with documentation improvements.
title: ''
labels: ''
assignees: ''
---

### Documentation request

Documentation is a high priority for outlines. If you would like to see something added to the documentation, please help us out by:

- Checking to see if the documentation does not already exist.
- Providing a detailed explanation of what you'd like to understand better.
- Highlighting any specific difficulties you ran into.

### Are you willing to open a PR?

Tell us whether you are willing to submit a PR for this yourself, we'd greatly appreciate it!

Thanks for contributing!
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ A few important guidelines and requirements before we can merge your PR:
Consider opening a **Draft PR** if your work is still in progress but you would
like some feedback from other contributors.

[issues]: https://github.com/outlines-dev/outlines/issues
[issues]: https://github.com/dottxt-ai/outlines/issues
[git-guidelines]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[docstring-guidelines]: https://numpydoc.readthedocs.io/en/latest/format.html
22 changes: 22 additions & 0 deletions .github/scripts/build_sdist_and_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Build sdist and wheel
python -m pip install -U pip
python -m pip install build
python -m build

# Check sdist install and imports
mkdir -p test-sdist
cd test-sdist
python -m venv venv-sdist
venv-sdist/bin/python -m pip install ../dist/outlines-*.tar.gz
venv-sdist/bin/python -c "import outlines"
cd ..

# Check wheel install and imports
mkdir -p test-wheel
cd test-wheel
python -m venv venv-wheel
venv-wheel/bin/python -m pip install ../dist/outlines-*.whl
venv-wheel/bin/python -c "import outlines"
cd ..
68 changes: 68 additions & 0 deletions .github/workflows/asv_benchmark_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Benchmark PR

on:
push:
pull_request:
types: [synchronize, labeled]
workflow_dispatch:
env:
PYTHON_VERSION: "3.10"
WORKING_DIR: ${{ github.workspace }}/benchmarks
BENCHMARKS_OUTPUT: ${{ github.workspace }}/benchmarks_output

permissions:
contents: read

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
benchmark-pr:
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'run-benchmarks') || github.ref == 'refs/heads/main' }}

defaults:
run:
working-directory: ${{ env.WORKING_DIR }}

steps:

- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install asv virtualenv lf-asv-formatter

- name: Create ASV machine config file
run: asv machine --machine gh-runner --yes

- name: Run Benchmarks - `PR HEAD` vs `main`
run: |
# prepare main branch for comparison
git remote add upstream https://github.com/${{ github.repository }}.git
git fetch upstream main

# Run benchmarks, allow errors, they will be caught in the next step
asv continuous upstream/main HEAD \
--no-stats --interleave-rounds -a repeat=3 || true

- name: BENCHMARK RESULTS
run: |
asv compare --factor=1.1 --no-stats --split upstream/main HEAD | tee ${{ env.BENCHMARKS_OUTPUT }}
if grep -q "Benchmarks that have got worse" "${{ env.BENCHMARKS_OUTPUT }}"; then
echo "Performance degradation detected!"
exit 1
fi
1 change: 1 addition & 0 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build the documentation
on:
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build:
Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/publish_documentation.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: Publish the documentation

on:
workflow_dispatch:
push:
branches:
- main
release:
types:
- created

permissions:
contents: write
Expand All @@ -13,6 +17,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.x
Expand All @@ -24,7 +30,24 @@ jobs:
restore-keys: |
mkdocs-material-
- run: pip install -r requirements-doc.txt
- name: Build documentation
- run: mkdocs build

- name: Set up Git
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com

- name: Publish Tag as latest
env:
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
if: github.event_name == 'release'
run: |
mike deploy --push --update-aliases ${{ github.ref_name }} latest
mike set-default --push latest

- name: Publish main as unstable
env:
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
run: mkdocs gh-deploy --force
if: github.event_name == 'push'
run: |
mike deploy --push --update-aliases ${{ github.ref_name }} unstable
21 changes: 2 additions & 19 deletions .github/workflows/release_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,11 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Build sdist and wheel
run: |
python -m pip install -U pip
python -m pip install build
python -m build
- name: Build SDist and Wheel
run: ./.github/scripts/build_sdist_and_wheel.sh
- name: Check that the package version matches the Release name
run: |
grep -Rq "^Version: ${GITHUB_REF:10}$" outlines.egg-info/PKG-INFO
- name: Check sdist install and imports
run: |
mkdir -p test-sdist
cd test-sdist
python -m venv venv-sdist
venv-sdist/bin/python -m pip install ../dist/outlines-*.tar.gz
venv-sdist/bin/python -c "import outlines"
- name: Check wheel install and imports
run: |
mkdir -p test-wheel
cd test-wheel
python -m venv venv-wheel
venv-wheel/bin/python -m pip install ../dist/outlines-*.whl
venv-wheel/bin/python -c "import outlines"
- name: Publish to PyPi
uses: pypa/[email protected]
with:
Expand Down
47 changes: 33 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.10"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -32,16 +32,30 @@ jobs:
- name: Set up test environment
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install -e .[test]
- name: Create matrix id
id: matrix-id
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: |
echo $MATRIX_CONTEXT
export MATRIX_ID=`echo $MATRIX_CONTEXT | md5sum | cut -c 1-32`
echo $MATRIX_ID
echo "::set-output name=id::$MATRIX_ID"
- name: Run tests
run: |
pytest --cov=outlines
pytest -x --cov=outlines
env:
COVERAGE_FILE: .coverage.${{ steps.matrix-id.outputs.id }}
- name: Upload coverage data
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-data
path: .coverage*
path: .coverage.*
if-no-files-found: ignore
include-hidden-files: true
# TODO FIXME: This is only using the last run
overwrite: true

coverage:
name: Combine & check coverage.
Expand All @@ -62,29 +76,34 @@ jobs:
run: |
pip install --upgrade "coverage[toml]>=5.1" diff-cover

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage-data

- name: Fetch master for coverage diff
- name: Fetch main for coverage diff
run: |
git fetch --no-tags --prune origin main

- name: Combine coverage & fail if it's <100%.
run: |
# Combine coverage files (not needed now, but maybe later)
# python -m coverage combine

# Produce an html report with absolute coverage information
python -m coverage combine
python -m coverage html --skip-covered --skip-empty

# Report relative coverage and write to the workflow's summary
python -m coverage xml
diff-cover coverage.xml --markdown-report=coverage.md --fail-under=100 || (cat coverage.md >> $GITHUB_STEP_SUMMARY && exit 1)

- name: Upload HTML report if check failed.
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: html-report
path: htmlcov
# TODO FIXME: This is only using the last run
overwrite: true
if: ${{ failure() }}

build-wheel:
name: Build Wheel and Test SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build SDist and Wheel
run: ./.github/scripts/build_sdist_and_wheel.sh
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ docs/build
.idea/
*.gguf
.venv
benchmarks/results
.python-version

# Remove doc build folders
.cache/
build/
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ repos:
- id: mypy
args: [--allow-redefinition]
exclude: ^examples/
additional_dependencies: [types-tqdm, types-Pillow]
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ COPY outlines ./outlines
RUN --mount=source=.git,target=.git,type=bind \
pip install --no-cache-dir .[serve]

# https://outlines-dev.github.io/outlines/reference/vllm/
ENTRYPOINT python3 -m outlines.serve.serve
# https://dottxt-ai.github.io/outlines/reference/vllm/
ENTRYPOINT ["python3", "-m", "outlines.serve.serve"]
Loading