diff --git a/allennlp/commands/train.py b/allennlp/commands/train.py index 1bebdfceca0..878e1446906 100644 --- a/allennlp/commands/train.py +++ b/allennlp/commands/train.py @@ -236,7 +236,7 @@ def train_model( world_size = num_nodes * num_procs logging.info( - f"Switching to distributed training mode since multiple GPUs are configured" + f"Switching to distributed training mode since multiple GPUs are configured | " f"Master is at: {master_addr}:{master_port} | Rank of this node: {node_rank} | " f"Number of workers in this node: {num_procs} | Number of nodes: {num_nodes} | " f"World size: {world_size}" diff --git a/allennlp/common/file_utils.py b/allennlp/common/file_utils.py index 977a1ffbe70..c40ca10872c 100644 --- a/allennlp/common/file_utils.py +++ b/allennlp/common/file_utils.py @@ -283,7 +283,7 @@ def _http_get(url: str, temp_file: IO) -> None: req = session.get(url, stream=True) content_length = req.headers.get("Content-Length") total = int(content_length) if content_length is not None else None - progress = Tqdm.tqdm(unit="B", total=total) + progress = Tqdm.tqdm(unit="B", total=total, desc="downloading") for chunk in req.iter_content(chunk_size=1024): if chunk: # filter out keep-alive new chunks progress.update(len(chunk)) diff --git a/allennlp/data/dataset_readers/dataset_reader.py b/allennlp/data/dataset_readers/dataset_reader.py index 673901bf179..828aaddc114 100644 --- a/allennlp/data/dataset_readers/dataset_reader.py +++ b/allennlp/data/dataset_readers/dataset_reader.py @@ -282,7 +282,7 @@ def _instances_to_cache_file(self, cache_filename, instances) -> None: # Then we just copy the file over to `cache_filename`. with CacheFile(cache_filename, mode="w+") as cache_handle: logger.info("Caching instances to temp file %s", cache_handle.name) - for instance in Tqdm.tqdm(instances): + for instance in Tqdm.tqdm(instances, desc="caching instances"): cache_handle.write(self.serialize_instance(instance) + "\n") def text_to_instance(self, *inputs) -> Instance: @@ -381,7 +381,7 @@ def _multi_worker_islice( islice = itertools.islice(iterable, start_index, self.max_instances, step_size) if wrap_with_tqdm: - islice = Tqdm.tqdm(islice) + islice = Tqdm.tqdm(islice, desc="reading instances") if transform is not None: return (transform(x) for x in islice) diff --git a/allennlp/data/vocabulary.py b/allennlp/data/vocabulary.py index bdd9a880557..6680472a0e9 100644 --- a/allennlp/data/vocabulary.py +++ b/allennlp/data/vocabulary.py @@ -288,7 +288,7 @@ def from_instances( padding_token = padding_token if padding_token is not None else DEFAULT_PADDING_TOKEN oov_token = oov_token if oov_token is not None else DEFAULT_OOV_TOKEN namespace_token_counts: Dict[str, Dict[str, int]] = defaultdict(lambda: defaultdict(int)) - for instance in Tqdm.tqdm(instances): + for instance in Tqdm.tqdm(instances, desc="building vocab"): instance.count_vocab_items(namespace_token_counts) return cls(