Skip to content

Commit

Permalink
Add check-json to pre-commit linters, and fix invalid ann-bench JSON …
Browse files Browse the repository at this point in the history
…config (#1894)

The ann-bench conf files had a couple of datasets with invalid JSON config files, causing them to fail to run.

This adds a check-json pre-commit hook to detect invalid json, which would have failed on these files with:

```
python/raft-ann-bench/src/raft-ann-bench/run/conf/mnist-784-euclidean.json: Failed to json decode (Expecting value: line 1 column 1 (char 0))
python/raft-ann-bench/src/raft-ann-bench/run/conf/glove-100-inner.json: Failed to json decode (Expecting ',' delimiter: line 686 column 7 (char 15218))
```

Authors:
  - Ben Frederickson (https://github.com/benfred)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #1894
  • Loading branch information
benfred authored Oct 12, 2023
1 parent 7d66266 commit 637019e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ repos:
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-json

default_language_version:
python: python3
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@
"algo": "faiss_gpu_ivf_flat",
"build_param": {"nlist":8192},
"file": "glove-100-inner/faiss_gpu_ivf_flat/nlist8192",
"file": "index/glove-100-inner/faiss_ivf_flat/nlist8192",
"search_params": [
{
"nprobe": 1
Expand Down Expand Up @@ -682,7 +681,7 @@
"algo": "faiss_gpu_flat",
"build_param": {},
"file": "glove-100-inner/faiss_gpu_flat/flat",
"search_params": [{}]
"search_params": [{}],
"search_result_file": "result/glove-100-inner/faiss_gpu_flat/flat"
},

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
c{
{
"dataset": {
"name": "mnist-784-euclidean",
"base_file": "mnist-784-euclidean/base.fbin",
Expand Down

0 comments on commit 637019e

Please sign in to comment.