Skip to content

Commit

Permalink
use llm-foundry for ICL metrics (#287)
Browse files Browse the repository at this point in the history
* use llm-foundry for ICL metrics

* replaced InContextLearningQAAccuracy with InContextLearningGenerationExactMatchAccuracy, and removed the commented line for code evals

* resolve lint check

* Update requirements_test.txt

* Update requirements_test.txt

---------

Co-authored-by: Achal Dave <[email protected]>
Co-authored-by: jmercat <[email protected]>
Co-authored-by: sedrick-keh-tri <[email protected]>
  • Loading branch information
4 people authored Jul 23, 2024
1 parent c0f1319 commit 9bb92ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions open_lm/utils/llm_foundry_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"""Implements a Hugging Causal LM wrapped inside a :class:`.ComposerModel`."""

from typing import Mapping, Union

from composer.metrics.nlp import (
from llmfoundry.eval.metrics.nlp import (
InContextLearningLMAccuracy,
InContextLearningLMExpectedCalibrationError,
InContextLearningMCExpectedCalibrationError,
InContextLearningMultipleChoiceAccuracy,
InContextLearningQAAccuracy,
InContextLearningCodeEvalAccuracy,
InContextLearningGenerationExactMatchAccuracy,
)
from composer.metrics.nlp import (
LanguageCrossEntropy,
LanguagePerplexity,
)
Expand All @@ -33,10 +33,9 @@
LanguagePerplexity(),
InContextLearningLMAccuracy(),
InContextLearningMultipleChoiceAccuracy(),
InContextLearningQAAccuracy(),
InContextLearningGenerationExactMatchAccuracy(),
InContextLearningLMExpectedCalibrationError(),
InContextLearningMCExpectedCalibrationError(),
InContextLearningCodeEvalAccuracy(),
]


Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pytest-cov==3.0.0
pytest-xdist==2.5.0
pytest==7.0.1
tensorboard==2.14.1
llm-foundry==0.7.0
llm-foundry==0.9.0

0 comments on commit 9bb92ef

Please sign in to comment.