Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
czaloom committed Dec 12, 2024
1 parent c9ae931 commit 10aa30c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ pre-commit:
pre-commit install
pre-commit run --all

tests:
@echo "Running unit tests..."
pytest ./lite/tests/text_generation -v

integration-tests:
@echo "Running external integration tests..."
pytest ./lite/tests/text_generation -v
test:
@echo "Running tests..."
pytest tests/classification
pytest tests/object_detection
pytest tests/semantic_segmentation
pytest tests/text_generation

clean:
@echo "Cleaning up temporary files..."
Expand Down
7 changes: 1 addition & 6 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,7 @@ For linting and code formatting use:
make pre-commit
```

For unit and functional testing:
Run all tests using:
```shell
make tests
```

For integration testing:
```shell
make external-tests
```
4 changes: 2 additions & 2 deletions src/valor_lite/classification/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def compute_confusion_matrix(
confusion_matrix = np.full(
(n_scores, n_labels, n_labels, 2 * n_examples + 1),
fill_value=-1.0,
dtype=np.float64,
dtype=np.float32,
)
unmatched_ground_truths = np.full(
(n_scores, n_labels, n_examples + 1),
Expand Down Expand Up @@ -389,4 +389,4 @@ def compute_confusion_matrix(
1 : misprd_label_examples.shape[0] + 1,
] = misprd_label_examples[:, 0].flatten()

return confusion_matrix, unmatched_ground_truths
return confusion_matrix, unmatched_ground_truths # type: ignore[reportReturnType]
4 changes: 2 additions & 2 deletions src/valor_lite/object_detection/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,12 @@ def compute_confusion_matrix(
confusion_matrix = -1 * np.ones(
# (datum idx, gt idx, pd idx, pd score) * n_examples + count
(n_ious, n_scores, n_labels, n_labels, 4 * n_examples + 1),
dtype=np.float64,
dtype=np.float32,
)
unmatched_predictions = -1 * np.ones(
# (datum idx, pd idx, pd score) * n_examples + count
(n_ious, n_scores, n_labels, 3 * n_examples + 1),
dtype=np.float64,
dtype=np.float32,
)
unmatched_ground_truths = -1 * np.ones(
# (datum idx, gt idx) * n_examples + count
Expand Down

0 comments on commit 10aa30c

Please sign in to comment.