Offline Mode
You can put Dorsal into Offline Mode by setting the DORSAL_OFFLINE environment variable.
-
Offline Mode will block any calls to the DorsalHub API from functions and classes within Dorsal, such as those for accessing file records or validating tags and annotations.
-
Offline Mode will not block network calls to or from resources other than the DorsalHub API, nor will it modify any environment settings external to Dorsal.
- For example, if your Pipeline includes a custom Annotation Model which downloads model weights at run-time from huggingface, this will continue to work in Offline Mode.
Enable Offline Mode if you are integrating Dorsal into a service and do not require any DorsalHub API features.
Why not just not set an API Key?
Simply not setting an API Key in Dorsal is a de facto offline mode, as the DorsalHub API already rejects any requests without a valid API Key.
However, if you are using Dorsal in a strictly offline way (e.g. integrated into another service, as a pure extraction tool) then explicitly setting DORSAL_OFFLINE is better:
- It's intentional: Prevent Dorsal from even trying to authenticate
- It's explicit: Catch
DorsalOfflineErrorinstead ofAuthError
Enabling Offline Mode
Setting this variable puts Dorsal into offline mode, preventing Dorsal from making requests to the DorsalHub API