Skip to content

Conversation

@puririshi98
Copy link
Contributor

@puririshi98 puririshi98 commented Sep 16, 2024

this last minute commit broke things: e331dcd

the changes to , columns=... is for

Traceback (most recent call last):
  File "/opt/pyg/pytorch_geometric/examples/llm/g_retriever.py", line 262, in <module>
    train(
  File "/opt/pyg/pytorch_geometric/examples/llm/g_retriever.py", line 132, in train
    train_dataset = WebQSPDataset(path, split='train')
  File "/usr/local/lib/python3.10/dist-packages/torch_geometric/datasets/web_qsp_dataset.py", line 145, in __init__
    super().__init__(root, force_reload=force_reload)
  File "/usr/local/lib/python3.10/dist-packages/torch_geometric/data/in_memory_dataset.py", line 81, in __init__
    super().__init__(root, transform, pre_transform, pre_filter, log,
  File "/usr/local/lib/python3.10/dist-packages/torch_geometric/data/dataset.py", line 115, in __init__
    self._process()
  File "/usr/local/lib/python3.10/dist-packages/torch_geometric/data/dataset.py", line 262, in _process
    self.process()
  File "/usr/local/lib/python3.10/dist-packages/torch_geometric/datasets/web_qsp_dataset.py", line 202, in process
    nodes.node_attr = nodes.node_attr.fillna("")
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/generic.py", line 6299, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'node_attr'

then the LongTensor change is for

    return scatter(edge_attr, col, 0, num_nodes, fill_value)
  File "/usr/local/lib/python3.10/dist-packages/torch_geometric/utils/_scatter.py", line 79, in scatter
    count.scatter_add_(0, index, src.new_ones(src.size(dim)))
RuntimeError: scatter(): Expected dtype int64 for index

this is the handle the edgecase where the Question Answer pair has no knowledge graph associated

@puririshi98 puririshi98 changed the title fixes for last min changes to the WebQSP PR. these are essential for … fixes for last min changes to the WebQSP PR. Sep 16, 2024
Copy link
Member

@akihironitta akihironitta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if the change is manually tested (as we don't have unit tests for torch_geometric.datasets)!

@rusty1s rusty1s changed the title fixes for last min changes to the WebQSP PR. Fix for empty pd.DataFrame in WebQSPDataset Sep 17, 2024
@rusty1s rusty1s merged commit 642f831 into master Sep 17, 2024
@rusty1s rusty1s deleted the fix-webqsp branch September 17, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants