Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

The model should return just the generated text, not the prompt text + generated text. #271

Open
monsieurpooh opened this issue Jan 23, 2022 · 2 comments
Labels
feature request A feature that isn't implemented yet.

Comments

@monsieurpooh
Copy link

monsieurpooh commented Jan 23, 2022

There is no reason we would want the prompted text + generated text since we already know the prompted text because we fed it to the input of the program. Returning prompted text + generated text can lead to some unexpected issues. For example, in my program I say that the generated text is the returnedText.substring(prompt.length). But this can fail if there are single quote chars "'" which get escaped and appear as "\'" in the output, meaning the start of the returned text will be later than expected.

@monsieurpooh monsieurpooh added the feature request A feature that isn't implemented yet. label Jan 23, 2022
@StellaAthena
Copy link
Member

in my program I say that the generated text is the returnedText.substring(prompt.length). But this can fail if there are single quote chars "'" which get escaped and appear as "'" in the output, meaning the start of the returned text will be later than expected.

Can you provide an example showing how this is problematic? I don't feel like I am understanding.

@monsieurpooh
Copy link
Author

I typed slash + single-quote but github corrected it to just single-quote; I have updated my comment to fix it.

For example If prompt is "I'm good" the returned text would be "I\'m good blah blah etc", and I am not sure if the cause is a bug in my code or transformers code. It would be more useful to just receive " blah blah etc"; I don't know why I would need to know the text I already provided to the program. However, I've implemented a workaround which is to replace all instances of backslash with empty string

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request A feature that isn't implemented yet.
Projects
None yet
Development

No branches or pull requests

2 participants