Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

[TextGeneration] Add GeneratedText and update TextGenerationOutput#1240

Merged
dsikka merged 7 commits into
mainfrom
textgen_update
Sep 19, 2023
Merged

[TextGeneration] Add GeneratedText and update TextGenerationOutput#1240
dsikka merged 7 commits into
mainfrom
textgen_update

Conversation

@dsikka

@dsikka dsikka commented Sep 14, 2023

Copy link
Copy Markdown
Contributor

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

@bfineran bfineran left a comment

Copy link
Copy Markdown
Contributor

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
Comment thread src/deepsparse/transformers/pipelines/text_generation.py Outdated
Comment thread src/deepsparse/transformers/pipelines/text_generation.py
@dbogunowicz

Copy link
Copy Markdown
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
@dsikka dsikka dismissed stale reviews from dbogunowicz and bfineran via 6a79bca September 15, 2023 17:39

@dbogunowicz dbogunowicz left a comment

Copy link
Copy Markdown
Contributor

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
@dsikka dsikka deleted the textgen_update branch September 19, 2023 10:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants