Skip to content

Commit

Permalink
hack so we can get value out of the test until we deal with localized…
Browse files Browse the repository at this point in the history
… prompt files in a more dignified way
  • Loading branch information
rogthefrog committed Jan 7, 2025
1 parent 01b49c5 commit ce26e2e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions plugins/validation_tests/test_object_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
from modelgauge.config import load_secrets_from_config
from modelgauge.dependency_helper import FromSourceDependencyHelper
from modelgauge.load_plugins import load_plugins
from modelgauge.locales import EN_US # see "workaround" below
from modelgauge.prompt import SUTOptions, TextPrompt
from modelgauge.record_init import InitializationRecord
from modelgauge.sut import PromptResponseSUT, SUTResponse
from modelgauge.sut_capabilities import AcceptsTextPrompt
from modelgauge.sut_registry import SUTS
from modelgauge.suts.huggingface_chat_completion import HUGGING_FACE_TIMEOUT
from modelgauge.test_registry import TESTS
from modelgauge.tests.safe_v1 import BaseSafeTestVersion1 # see "workaround" below
from modelgauge_tests.fake_secrets import fake_all_secrets
from modelgauge_tests.utilities import expensive_tests

Expand All @@ -40,10 +42,7 @@ def shared_run_dir(tmp_path_factory):
# Some tests require such large downloads / complex processing
# that we don't want to do that even on expensive_tests.
# If your Test is timing out, consider adding it here.
TOO_SLOW = {
"real_toxicity_prompts",
"bbq",
}
TOO_SLOW = {"real_toxicity_prompts", "bbq"}


@expensive_tests
Expand All @@ -52,6 +51,12 @@ def shared_run_dir(tmp_path_factory):
@pytest.mark.parametrize("test_name", [key for key, _ in TESTS.items() if key not in TOO_SLOW])
def test_all_tests_make_test_items(test_name, shared_run_dir):
test = TESTS.make_instance(test_name, secrets=_FAKE_SECRETS)

# TODO remove when localized files are handled better
# workaround
if isinstance(test, BaseSafeTestVersion1) and test.locale != EN_US:
return

if isinstance(test, PromptResponseTest):
test_data_path = os.path.join(shared_run_dir, test.__class__.__name__)
dependency_helper = FromSourceDependencyHelper(
Expand Down

0 comments on commit ce26e2e

Please sign in to comment.