prompt-to-prompt icon indicating copy to clipboard operation
prompt-to-prompt copied to clipboard

get_replacement_mapper_ in seq_aligner.py

Open yuhaoliu7456 opened this issue 1 year ago • 6 comments

Thanks for this amazing work. I tested many times on this func, and this func always returns a diagonal matrix with 1s on the diagonal. Why don't you use the built-in func in the torch directly if this is right? If this needs to be corrected, can you help explain this issue?

yuhaoliu7456 avatar May 15 '23 13:05 yuhaoliu7456

I also have same question. Can anyone answer for us? :)

HyelinNAM avatar Jun 13 '23 10:06 HyelinNAM

I think this is because your source prompt and target prompt are almost the same, and the processed results of the tokenizer are so similar to the space-splited ones. For these cases, it will return the diagonal matrix. However, If the source text is "a lion is eating an apple", and the edited text is "a lovely-dog is eating an apple", the "lion" will be mapped to "lovely", "-", and "dog", because the tokenizer will tokenized the "lovely-dog" into "lovely", "-", "dog".

Kenneth-Wong avatar Sep 27 '23 09:09 Kenneth-Wong

I have the same question...

sucongCJS avatar Dec 15 '23 07:12 sucongCJS

I think this is because your source prompt and target prompt are almost the same, and the processed results of the tokenizer are so similar to the space-splited ones. For these cases, it will return the diagonal matrix. However, If the source text is "a lion is eating an apple", and the edited text is "a lovely-dog is eating an apple", the "lion" will be mapped to "lovely", "-", and "dog", because the tokenizer will tokenized the "lovely-dog" into "lovely", "-", "dog".

you are right bro!

sucongCJS avatar Dec 15 '23 08:12 sucongCJS

I have the same question,too.

ybx193670 avatar Feb 28 '24 11:02 ybx193670

I have the same question,too. Reason: seq_aligner file is not being imported Action: Create a new unit folder, create an empty init.py in it, and move the seq_aligner.py into this folder, and remember to modify the path when importing at the end

ybx193670 avatar Feb 29 '24 06:02 ybx193670