IBM/unitxt

Current Formats do support different target_prefix in demos

Closed this issue · 3 comments

Today the code in formats.py assumes the target prefix for the demos is taken from the instance. This may cause subtle issue when the target_prefix uses input field for formatting (e.g. target_prefix="The answer for {num1} + {num2} is")

can you explain why it causes issue in that case? or in what cases it will fail?

Since we take the target_prefix from the main instance and not the demos, if the instance is verbalized the calculation of 1+2 and the demo need to verbalize 4+5, it will use the instance target_prefix verbalization in the demos:

User: calculate 4+5?
Assistant: The answer of 1+2 is 9 <--- demo (note the wrong target_prefix)

User: calculate 1+2?
Assistant: The answer of 1+2 is

Resolved by PR #1031