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

[Text Gen UX] top level constructor aliases + code gen subclass #1274

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

bfineran
Copy link
Member

@bfineran bfineran commented Sep 25, 2023

This PR adds the requested constructor aliases for the main text generation tasks. also adds a code generation subclass to reference - idea here is that if there is ever extra processing or defaults requested for code generation, it will be easy to add in to the subclass

requested UX:

from deepsparse import TextGeneration, CodeGeneration, Chat

text_pipeline = TextGeneration(model=MODEL, **kwargs)
text_result = text_pipeline(prompt=PROMPT, **kwargs)

code_pipeline = CodeGeneration(model=MODEL, **kwargs)
code_result = code_pipeline(prompt=PROMPT, **kwargs)

chat_pipeline = Chat(model=MODEL, **kwargs)
chat_result = chat_pipeline(prompt=PROMPT, *args, **kwargs)

test_plan:
manually verified:

from deepsparse import CodeGeneration

code_pipeline = CodeGeneration(model="/home/benjamin/neuralmagic/models/codegen_mono-350m-bigpython_bigquery_thepile-pruned50/deployment", engine_type="onnxruntime")
code_pipeline(prompt="def hello_world:", generation_config=dict(max_new_tokens=10))

@bfineran bfineran self-assigned this Sep 25, 2023
Copy link
Contributor

@dsikka dsikka left a comment

Choose a reason for hiding this comment

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

LGTM

@bfineran bfineran merged commit 20a6157 into main Sep 25, 2023
13 checks passed
@bfineran bfineran deleted the generation-ux-updates branch September 25, 2023 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants