Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 24, 2025
1 parent 1c519af commit 30e28fa
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions torch_geometric/nn/nlp/txt2kg.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def add_doc_2_KG(
in_chunks_per_proc = {
j:
chunks[j *
meta_chunk_size:min((j + 1) *
meta_chunk_size, len(chunks))]
meta_chunk_size:min((j + 1) *
meta_chunk_size, len(chunks))]
for j in range(num_procs)
}

Expand All @@ -159,20 +159,22 @@ def add_doc_2_KG(
mp.spawn(
_multiproc_helper,
args=(in_chunks_per_proc, _parse_n_check_triples,
_chunk_to_triples_str_cloud, self.NVIDIA_API_KEY,
self.NIM_MODEL), nprocs=num_procs)
_chunk_to_triples_str_cloud,
self.NVIDIA_API_KEY, self.NIM_MODEL),
nprocs=num_procs)
except:
mp.spawn(
_multiproc_helper,
args=(in_chunks_per_proc, _parse_n_check_triples,
_chunk_to_triples_str_cloud, self.NVIDIA_API_KEY,
self.NIM_MODEL), nprocs=num_procs)
_chunk_to_triples_str_cloud,
self.NVIDIA_API_KEY, self.NIM_MODEL),
nprocs=num_procs)
except:
mp.spawn(
_multiproc_helper,
args=(in_chunks_per_proc, _parse_n_check_triples,
_chunk_to_triples_str_cloud, self.NVIDIA_API_KEY,
self.NIM_MODEL), nprocs=num_procs)
_multiproc_helper,
args=(in_chunks_per_proc, _parse_n_check_triples,
_chunk_to_triples_str_cloud, self.NVIDIA_API_KEY,
self.NIM_MODEL), nprocs=num_procs)

# Collect the results from each process
self.relevant_triples[key] = []
Expand Down

0 comments on commit 30e28fa

Please sign in to comment.