Missing f prefix on f-strings fix (#4380)

Summary:
Fixes https://github.com/facebookresearch/fairseq/issues/4379

Pull Request resolved: https://github.com/facebookresearch/fairseq/pull/4380

Reviewed By: cbalioglu

Differential Revision: D36454259

Pulled By: dianaml0

fbshipit-source-id: cf47b4d4c5e80e1f3bc5b400e40f1192dfa84933
This commit is contained in:
code-review-doctor 2022-05-23 16:26:35 -07:00 committed by Facebook GitHub Bot
parent b5a039c292
commit b5e7b25091
4 changed files with 5 additions and 5 deletions

View File

@ -70,7 +70,7 @@ class HuffmanMMapIndex:
(version,) = struct.unpack("<Q", stream.read(8))
assert (
self._VERSION == version
), "Unexpected file version f{version} != code version f{self._VERSION}"
), f"Unexpected file version{version} != code version {self._VERSION}"
# read length of data file
(self._data_len,) = struct.unpack("<Q", stream.read(8))

View File

@ -57,7 +57,7 @@ class CountingIterator(object):
except StopIteration:
raise IndexError(
f"Iterator expected to have length {self.total}, "
"but exhausted at position {self.n}."
f"but exhausted at position {self.n}."
)
self.n += 1
return x

View File

@ -919,7 +919,7 @@ class MultilingualDatasetManager(object):
# monolingual data requires tgt only
assert src is None or src == tgt, (
f"error: src={src}, "
"tgt={tgt} for data_category={data_category}"
f"tgt={tgt} for data_category={data_category}"
)
num_shards_dict[key] = shards_dict[tgt]
else:
@ -972,7 +972,7 @@ class MultilingualDatasetManager(object):
lang_dirs = [x if len(x) > 1 else (x[0], x[0]) for x in lang_dirs]
for src, tgt in lang_dirs:
assert src is not None or data_category == "mono_dae", (
f"error: src={src}, " "tgt={tgt} for data_category={data_category}"
f"error: src={src}, " f"tgt={tgt} for data_category={data_category}"
)
# logger.info(f"preparing param for {data_category}: {src} - {tgt}")
key = self.get_dataset_key(data_category, src, tgt)

View File

@ -95,7 +95,7 @@ def eval_lm(
}
else:
raise NotImplementedError(
"--post-process={post_process} is not implemented"
f"--post-process={post_process} is not implemented"
)
bpe_len = len(bpe_cont)
else: