generated from dataforgoodfr/d4g-project-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add more documentation of warnings and errors
- Loading branch information
1 parent
8f219b3
commit 0bb7acf
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,53 @@ | ||
# Warnings and Errors | ||
|
||
EcoLogits may encounter situations where the calculation of environmental impacts has **high risk of inaccuracies or uncertainties** (reported as **warnings**), or where the calculation **fails** due to certain reasons like misconfiguration (reported as **errors**). | ||
|
||
Warnings and errors are reported in the [`Impacts`][impacts.modeling.Impacts] pydantic model within the `warnings` and `errors` fields respectively. Each warning or error contains a `code` (all listed below) and a `message` explaining the issue. | ||
|
||
!!! note "Silent reporting of warnings and errors" | ||
|
||
By default, warnings and errors are reported **silently**. This means you won't see any warning logged or exception raised. This approach ensures your program continues to execute and avoids spamming the log output, especially when executing many requests. | ||
|
||
Code example on how to determine **if your request resulted in any warnings or errors** and how to retrieve them. | ||
|
||
```python | ||
from ecologits import EcoLogits | ||
|
||
EcoLogits.init() | ||
|
||
response = ... # Request code goes here | ||
|
||
if response.impacts.has_warnings: | ||
for w in response.impacts.warnings: | ||
print(w) | ||
|
||
if response.impacts.has_errors: | ||
for e in response.impacts.errors: | ||
print(e) | ||
``` | ||
|
||
|
||
## Warnings | ||
|
||
List of all the warnings that EcoLogits can report. | ||
|
||
### `model-arch-not-released` | ||
|
||
This warning is reported when the model architecture is not disclosed by the provider. Thus, the estimation of environmental impacts is based on a assumption of the model architecture (e.g. dense or mixture of experts, number of parameters). | ||
|
||
### `model-arch-multimodal` | ||
|
||
This warning is reported when the model is multimodal. EcoLogits uses energy benchmarking data from open source LLMs that can only generate text. Models that can generate (or use as input) data from other modalities such as image, audio or video are currently not fully supported. | ||
|
||
|
||
## Errors | ||
|
||
List of all the errors that EcoLogits can report. | ||
|
||
### `model-not-registered` | ||
|
||
### `zone-not-registerd` | ||
This error is reported when the selected model is not registered. This can happen when the model has been released recently or if you are using a custom model (such as fine-tuned models). In the first case you can try updating EcoLogits to the latest version, if the error persists, you can [open up an issue :octicons-link-external-16:](https://github.com/genai-impact/ecologits/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml). | ||
|
||
### `zone-not-registered` | ||
|
||
This error is reported when the selected geographical zone is not registered. This can happen if the configured zone does not exist or if the custom zone is not properly registered. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters