Skip to content

Commit b6576c5

Browse files
committed
update
1 parent c204e58 commit b6576c5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/llm/utils/test_rag_backend_utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
preprocess_triplet,
1414
retrieval_via_pcst,
1515
)
16-
from torch_geometric.testing import withPackage
16+
from torch_geometric.testing import onlyRAG
1717

1818

1919
def test_preprocess_triplet():
@@ -22,6 +22,7 @@ def test_preprocess_triplet():
2222
assert processed == ('alice', 'works with', 'bob')
2323

2424

25+
@onlyRAG
2526
def test_batch_knn():
2627
query_embeddings = torch.randn(2, 64)
2728
candidate_embeddings = torch.randn(10, 64)
@@ -40,7 +41,7 @@ def test_batch_knn():
4041
"""Test retrieval_via_pcst"""
4142

4243

43-
@withPackage('pandas')
44+
@onlyRAG
4445
def create_mock_data(num_nodes=3, num_edges=2):
4546
import pandas as pd
4647
x = torch.randn(num_nodes, 16)
@@ -64,7 +65,7 @@ def create_mock_data(num_nodes=3, num_edges=2):
6465
edge_idx=edge_idx), textual_nodes, textual_edges
6566

6667

67-
@withPackage('pandas')
68+
@onlyRAG
6869
def test_empty_graph():
6970
import pandas as pd
7071

@@ -81,6 +82,7 @@ def test_empty_graph():
8182
assert desc.strip() == 'node_id,text\n\nsrc,edge_attr,dst'
8283

8384

85+
@onlyRAG
8486
def test_topk_zero():
8587
data, textual_nodes, textual_edges = create_mock_data()
8688
q_emb = torch.randn(1, 16)
@@ -118,6 +120,7 @@ def create_mock_graph_and_triples():
118120
return triples, graph
119121

120122

123+
@onlyRAG
121124
def test_apply_retrieval_via_pcst_isolated_node():
122125
triples, graph = create_mock_graph_and_triples()
123126
model = MockSentenceTransformer()

0 commit comments

Comments
 (0)