Skip to content

Use Faster FSM#1175

Merged
rlouf merged 1 commit intodottxt-ai:mainfrom
lapp0:performant-fsm
Sep 28, 2024
Merged

Use Faster FSM#1175
rlouf merged 1 commit intodottxt-ai:mainfrom
lapp0:performant-fsm

Conversation

@lapp0
Copy link
Copy Markdown
Contributor

@lapp0 lapp0 commented Sep 26, 2024

No description provided.

@lapp0 lapp0 changed the title Performant FSM Implementation Use Faster FSM Sep 26, 2024
"""Guide to generate text in the language of a regular expression."""

initial_state = 0
class RegexGuide(CoreRegexGuide):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to keep the RegexGuide here?

Copy link
Copy Markdown
Contributor Author

@lapp0 lapp0 Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the cached implementation of RegexGuide. Only __init__.py is changed to enable caching.

Comment on lines -210 to -227
def test_vllm_json_schema(model):
prompt = "Output some JSON. "

schema = """{
"title": "spam",
"type": "object",
"properties": {
"foo" : {"type": "boolean"},
"bar": {"type": "string", "maxLength": 4}
},
"required": ["foo", "bar"]
}
"""

sampling_params = SamplingParams(temperature=0)
result = generate.json(model, schema, whitespace_pattern="")(
prompt, max_tokens=100, seed=10, sampling_params=sampling_params
)
Copy link
Copy Markdown
Member

@rlouf rlouf Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing the vLLM integration tests in this PR? It should at least be a separate commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a mistake, reverted.

@lapp0 lapp0 force-pushed the performant-fsm branch 2 times, most recently from 7873cfc to 857b902 Compare September 27, 2024 23:29
@rlouf
Copy link
Copy Markdown
Member

rlouf commented Sep 28, 2024

LGTM!

@rlouf rlouf merged commit 30531e5 into dottxt-ai:main Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants