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 10, 2025
1 parent f9c522f commit f68b8f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion examples/llm/hotpot_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
# redundant since TXT2KG already provides lowercase
# in case loading a KG that was made some other way without lowercase
triples = [(i[0].lower(), i[1].lower(), i[2].lower()) for i in triples]


print("Size of KG (number of triples) =", len(triples))
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
Expand Down
3 changes: 2 additions & 1 deletion torch_geometric/nn/nlp/txt2kg.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ def _parse_n_check_triples(triples_str: str) -> List[Tuple[str, str, str]]:
split_trip = triple_str.split(',')
# remove blank space at beginning or end
split_trip = [(i[1:] if i[0] == " " else i) for i in split_trip]
split_trip = [(i[:-1].lower() if i[-1] == " " else i) for i in split_trip]
split_trip = [(i[:-1].lower() if i[-1] == " " else i)
for i in split_trip]
potential_trip = tuple(split_trip)
except: # noqa
continue
Expand Down

0 comments on commit f68b8f9

Please sign in to comment.