diff --git a/examples/llm/hotpot_qa.py b/examples/llm/hotpot_qa.py index ea32b9ce98f9..1a4fee36bae2 100644 --- a/examples/llm/hotpot_qa.py +++ b/examples/llm/hotpot_qa.py @@ -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") diff --git a/torch_geometric/nn/nlp/txt2kg.py b/torch_geometric/nn/nlp/txt2kg.py index 7fa02d00339f..9116a86f0613 100644 --- a/torch_geometric/nn/nlp/txt2kg.py +++ b/torch_geometric/nn/nlp/txt2kg.py @@ -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