Skip to content

Commit 7ca40d6

Browse files
committed
Fix empty dataframe handling in WebQSPDataset
1 parent 12421c2 commit 7ca40d6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend="flit_core.buildapi"
44

55
[project]
66
name="torch-geometric"
7-
version="2.6.0"
7+
version="2.6.1"
88
authors=[
99
{name="Matthias Fey", email="[email protected]"},
1010
]

Diff for: torch_geometric/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
contrib = LazyLoader('contrib', globals(), 'torch_geometric.contrib')
3131
graphgym = LazyLoader('graphgym', globals(), 'torch_geometric.graphgym')
3232

33-
__version__ = '2.6.0'
33+
__version__ = '2.6.1'
3434

3535
__all__ = [
3636
'Index',

Diff for: torch_geometric/datasets/web_qsp_dataset.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ def process(self) -> None:
196196
nodes = pd.DataFrame([{
197197
"node_id": v,
198198
"node_attr": k,
199-
} for k, v in raw_nodes.items()])
200-
edges = pd.DataFrame(raw_edges)
199+
} for k, v in raw_nodes.items()],
200+
columns=["node_id", "node_attr"])
201+
edges = pd.DataFrame(raw_edges,
202+
columns=["src", "edge_attr", "dst"])
201203

202204
nodes.node_attr = nodes.node_attr.fillna("")
203205
x = model.encode(
@@ -213,7 +215,7 @@ def process(self) -> None:
213215
edge_index = torch.tensor([
214216
edges.src.tolist(),
215217
edges.dst.tolist(),
216-
])
218+
], dtype=torch.long)
217219

218220
question = f"Question: {example['question']}\nAnswer: "
219221
label = ('|').join(example['answer']).lower()

0 commit comments

Comments
 (0)