Skip to content

Commit

Permalink
0.3.5 - vLLM integration notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
noamgat committed Oct 18, 2023
1 parent 11e3fd1 commit ee99beb
Show file tree
Hide file tree
Showing 4 changed files with 540 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lmformatenforcer/jsonschemaparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_allowed_characters(self) -> str:
# characters when the object stack is empty (= we are done parsing)
allowed_characters = self.object_stack[-1].get_allowed_characters() if self.object_stack else WHITESPACE_CHARACTERS
if self.num_consecutive_whitespaces >= MAX_CONSECUTIVE_WHITESPACES:
print("Filtering whitespace characters")
# print("Filtering whitespace characters")
allowed_characters = "".join(c for c in allowed_characters if c not in WHITESPACE_CHARACTERS)
return allowed_characters

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "lm-format-enforcer"
version = "0.3.4"
version = "0.3.5"
description = "Enforce the output format (JSON Schema, Regex etc) of a language model"
authors = ["Noam Gat <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion samples/colab_llama2_enforcer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"source": [
"## JSON Use case\n",
"\n",
"Now we demnostrate using ```JsonSchemaParser```. We create a pydantic model, generate the schema from it, and use that to enforce the format.\n",
"Now we demonstrate using ```JsonSchemaParser```. We create a pydantic model, generate the schema from it, and use that to enforce the format.\n",
"The output will always be in a format that can be parsed by the parser."
]
},
Expand Down
Loading

0 comments on commit ee99beb

Please sign in to comment.