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

[TextGeneration] Add GeneratedText and update TextGenerationOutput #1240

Merged
merged 7 commits into from
Sep 19, 2023

Conversation

dsikka
Copy link
Contributor

@dsikka dsikka commented Sep 14, 2023

Summary

Testing

  • Tested locally - sample output:
from deepsparse import Pipeline

pipeline = Pipeline.create(
   task="text_generation",
   model_path="/home/dsikka/.cache/sparsezoo/neuralmagic/opt-1.3b-opt_pretrain-quantW8A8/deployment",
   engine_type="onnxruntime"
)

inference = pipeline(sequences=["what", "hello?"], num_generated_predictions=2)
generations = inference.generations
print("First Generation")
print(generations[0])
print("\n")
print("Second Generation")
print(generations[1])

First Generation
[GeneratedText(text=' color is the willow fern?\nI got it from Panera years ago. Will do a full review of this Matt veg rose', score=None, finished=True, finished_reason='stop token generated.'), GeneratedText(text=" are your plans for your website?\nI was in the process of completing that actually. I mean, I'm probs not going to add more features like a hub video or anything but as far as making the website look prettier it's a work in progress. Anyways, by the look of the username I'm guessing you have some contacts in the film world? Want to work on something together?\nNot sure. LuckyIknew.com isn't exactly sparkling when I tried to navigate through it just now. Uhm... When are you going to put together all the footage and do it so the audio matches up with the footage?\nI'll do that now. I've had to go to my basement for a few weeks though, all the footage reels are in there. Will happen as soon as I can get back in there and redo it properly. Short of a whole bunch of stuff happening, I won't be able to put too much effort into it, sadly.", score=None, finished=True, finished_reason='stop token generated.')]

Second Generation
[GeneratedText(text=' houdini dragon edition? Oh every1 is spelling honey a weird way.... THE HELL DO YOU MEAN?\nMy word is brown?', score=None, finished=True, finished_reason='stop token generated.'), GeneratedText(text="!! hello?! where's her obsession with Yugoslavs?\nthe Yugoslavian attitudes were everyone stands still, only steps on the yard is path, slowly walks to the other side returns, dont, coulor-moning... all with a mix of 'joking' and half serious and i think thats why i like it", score=None, finished=True, finished_reason='stop token generated.')]

@dsikka dsikka marked this pull request as ready for review September 14, 2023 15:48
bfineran
bfineran previously approved these changes Sep 14, 2023
Copy link
Member

@bfineran bfineran left a comment

Choose a reason for hiding this comment

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

LGTM overall - let's check any downstream usages or tests of the pipeline that changing the output like this may break

@bfineran bfineran requested a review from mgoin September 14, 2023 20:31
@dbogunowicz
Copy link
Contributor

LGTM, let's add some testing and make sure that it doesn't break things downsteam (perplexity computation).

dbogunowicz
dbogunowicz previously approved these changes Sep 15, 2023
Copy link
Contributor

@dbogunowicz dbogunowicz left a comment

Choose a reason for hiding this comment

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

Nice

@dsikka dsikka merged commit 404e8a4 into main Sep 19, 2023
13 checks passed
@dsikka dsikka deleted the textgen_update branch September 19, 2023 10:04
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

4 participants