Skip to content

Commit

Permalink
Merge branch 'master' into fix/to_pytorch_performance
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbuniat committed Jan 8, 2021
2 parents 5a7201b + 27a1766 commit dbf9c78
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''
labels: "i: bug, i: needs triage"
assignees: ""

---

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: "enhancement"
labels: "i: enhancement, i: needs triage"
assignees: ''

---
Expand Down
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
---
name: Pull request
about: ""
title: "[PR]"
labels: "i: pull-request, i: needs triage"
assignees: ""

---

## 🚀 🚀 Pull Request

### All Submissions:
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ Activeloop’s Hub format lets you achieve faster inference at a lower cost. We

Check these and many more popular datasets on our [visualizer web app](https://app.activeloop.ai/datasets/popular) and load them directly for model training!

## README Badge

Using Hub? Add a README badge to let everyone know:


[![hub](https://img.shields.io/badge/powered%20by-hub%20-ff5a1f.svg)](https://github.com/activeloopai/Hub)

```
[![hub](https://img.shields.io/badge/powered%20by-hub%20-ff5a1f.svg)](https://github.com/activeloopai/Hub)
```

## Disclaimers

Expand Down
4 changes: 3 additions & 1 deletion hub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from hub.compute import transform
from hub.log import logger
import traceback
from hub.exceptions import DaskModuleNotInstalledException
from hub.exceptions import DaskModuleNotInstalledException, HubDatasetNotFoundException


def local_mode():
Expand Down Expand Up @@ -47,6 +47,8 @@ def load(tag):
return ds
except ImportError:
raise DaskModuleNotInstalledException
except HubDatasetNotFoundException:
raise
except Exception as e:
pass
# logger.warning(traceback.format_exc() + str(e))
Expand Down
2 changes: 1 addition & 1 deletion hub/collections/dataset/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ def load(tag, creds=None, session_creds=True) -> Dataset:
fs, path = _load_fs_and_path(tag, creds, session_creds=session_creds)
fs: fsspec.AbstractFileSystem = fs
path_2 = f"{path}/meta.json"
if not fs.exists(path):
if not fs.exists(path_2):
raise HubDatasetNotFoundException(tag)

with fs.open(path_2, "r") as f:
Expand Down
10 changes: 10 additions & 0 deletions hub/tests/test_hub_init.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from hub.exceptions import HubDatasetNotFoundException
import pytest

import hub
import hub.config
from hub.utils import dask_loaded
Expand All @@ -22,6 +25,13 @@ def test_load(caplog):
assert isinstance(obj, hub.Dataset) == True


def test_load_wrong_dataset():
try:
obj = hub.load("./data/dataset_that_does_not_exist")
except Exception as ex:
assert isinstance(ex, HubDatasetNotFoundException)


if __name__ == "__main__":
test_local_mode()
test_dev_mode()
Expand Down

0 comments on commit dbf9c78

Please sign in to comment.