Enforce string-formatting with f-strings (#10980)
* First third * Styling and fix mistake * Quality * All the rest * Treat %s and %d * typo * Missing ) * Apply suggestions from code review Co-authored-by: Lysandre Debut <lysandre@huggingface.co> Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
This commit is contained in:
@@ -39,7 +39,7 @@ class PhobertTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
|
||||
with open(self.vocab_file, "w", encoding="utf-8") as fp:
|
||||
for token in vocab_tokens:
|
||||
fp.write("{} {}".format(token, vocab_tokens[token]) + "\n")
|
||||
fp.write(f"{token} {vocab_tokens[token]}\n")
|
||||
with open(self.merges_file, "w", encoding="utf-8") as fp:
|
||||
fp.write("\n".join(merges))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user