You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the latest version of the code in the agent/componment/generate.py, I noticed that the usage of re.escape() was introduced in the following line:
prompt = re.sub(r"{%s}" % n, re.escape(str(v)), prompt)
This results in unwanted behavior where characters like whitespace (" "), hyphen ("-"), and other symbols are unnecessarily escaped, adding additional backslashes (""). In the previous version of the code, this issue did not exist, as the line used to be:
prompt = re.sub(r"{%s}" % n, str(v), prompt)
I am wondering what was the reason for adding re.escape() in the new version? Was it to address a specific issue?
The text was updated successfully, but these errors were encountered:
Describe your problem
In the latest version of the code in the agent/componment/generate.py, I noticed that the usage of re.escape() was introduced in the following line:
prompt = re.sub(r"{%s}" % n, re.escape(str(v)), prompt)
This results in unwanted behavior where characters like whitespace (" "), hyphen ("-"), and other symbols are unnecessarily escaped, adding additional backslashes (""). In the previous version of the code, this issue did not exist, as the line used to be:
prompt = re.sub(r"{%s}" % n, str(v), prompt)
I am wondering what was the reason for adding re.escape() in the new version? Was it to address a specific issue?
The text was updated successfully, but these errors were encountered: