(tmp_path, n=5, dim=384)
| 4 | |
| 5 | |
| 6 | def _make_index(tmp_path, n=5, dim=384): |
| 7 | rng = np.random.RandomState(42) |
| 8 | embs = rng.randn(n, dim).astype(np.float32) |
| 9 | embs = embs / np.linalg.norm(embs, axis=1, keepdims=True) |
| 10 | labels = [0] * n |
| 11 | np.save(tmp_path / "seed_embeddings.npy", embs) |
| 12 | with open(tmp_path / "seed_labels.json", "w") as f: |
| 13 | json.dump(labels, f) |
| 14 | return embs |
| 15 | |
| 16 | |
| 17 | def test_add_entry(tmp_path): |
no test coverage detected