Skip to content

Commit

Permalink
test: add example test
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelrince committed Feb 27, 2024
1 parent 063f858 commit d7c2bd7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion genai_impact/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from client_wrapper import OpenAI
from .client_wrapper import OpenAI
12 changes: 12 additions & 0 deletions tests/test_compute_impacts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pytest

from genai_impact.compute_impacts import compute_llm_impact


@pytest.mark.parametrize('model_size,output_tokens', [
(130, 1000),
(7, 150)
])
def test_compute_impacts_is_positive(model_size: float, output_tokens: int) -> None:
impacts = compute_llm_impact(model_size, output_tokens)
assert impacts.energy >= 0

0 comments on commit d7c2bd7

Please sign in to comment.