Spaces:
No application file
No application file
File size: 494 Bytes
480e694 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import pytest
from pathlib import Path
import pickle
import numpy as np
@pytest.fixture
def mock_embeddings():
return {
"embeddings": np.random.rand(10, 384),
"search_queries": ["query1", "query2"],
"product_names": ["product1", "product2"]
}
@pytest.fixture
def mock_model_path(tmp_path, mock_embeddings):
model_path = tmp_path / "product_embeddings.pkl"
with open(model_path, "wb") as f:
pickle.dump(mock_embeddings, f)
return model_path
|