Spaces:
No application file
No application file
import pytest | |
from pathlib import Path | |
import pickle | |
import numpy as np | |
def mock_embeddings(): | |
return { | |
"embeddings": np.random.rand(10, 384), | |
"search_queries": ["query1", "query2"], | |
"product_names": ["product1", "product2"] | |
} | |
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 | |