Skip to content

Commit

Permalink
Fix empty dataframe handling in WebQSPDataset
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Sep 26, 2024
1 parent 12421c2 commit 7ca40d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend="flit_core.buildapi"

[project]
name="torch-geometric"
version="2.6.0"
version="2.6.1"
authors=[
{name="Matthias Fey", email="[email protected]"},
]
Expand Down
2 changes: 1 addition & 1 deletion torch_geometric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
contrib = LazyLoader('contrib', globals(), 'torch_geometric.contrib')
graphgym = LazyLoader('graphgym', globals(), 'torch_geometric.graphgym')

__version__ = '2.6.0'
__version__ = '2.6.1'

__all__ = [
'Index',
Expand Down
8 changes: 5 additions & 3 deletions torch_geometric/datasets/web_qsp_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ def process(self) -> None:
nodes = pd.DataFrame([{
"node_id": v,
"node_attr": k,
} for k, v in raw_nodes.items()])
edges = pd.DataFrame(raw_edges)
} for k, v in raw_nodes.items()],
columns=["node_id", "node_attr"])
edges = pd.DataFrame(raw_edges,
columns=["src", "edge_attr", "dst"])

nodes.node_attr = nodes.node_attr.fillna("")
x = model.encode(
Expand All @@ -213,7 +215,7 @@ def process(self) -> None:
edge_index = torch.tensor([
edges.src.tolist(),
edges.dst.tolist(),
])
], dtype=torch.long)

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

0 comments on commit 7ca40d6

Please sign in to comment.