Skip to content

Commit

Permalink
test var handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ulya-tkch committed Sep 20, 2024
1 parent 0e8e31a commit 293a30b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 15 additions & 7 deletions tests/tlm/constants.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from typing import List

from cleanlab_studio.internal.constants import _VALID_TLM_MODELS

# Test TLM
TEST_PROMPT = "What is the capital of France?"
TEST_RESPONSE = "Paris"
TEST_PROMPT_BATCH = ["What is the capital of France?", "What is the capital of Ukraine?"]
TEST_RESPONSE_BATCH = ["Paris", "Kyiv"]
TEST_PROMPT: str = "What is the capital of France?"
TEST_RESPONSE: str = "Paris"
TEST_PROMPT_BATCH: List[str] = ["What is the capital of France?", "What is the capital of Ukraine?"]
TEST_RESPONSE_BATCH: List[str] = ["Paris", "Kyiv"]

# Test validation tests for TLM
MAX_PROMPT_LENGTH_TOKENS: int = 70_000
Expand All @@ -14,6 +16,12 @@
CHARACTERS_PER_TOKEN: int = 4

# Property tests for TLM
excluded_tlm_models = ["claude-3-sonnet", "claude-3.5-sonnet"]
VALID_TLM_MODELS = [model for model in _VALID_TLM_MODELS if model not in excluded_tlm_models]
MODELS_WITH_NO_PERPLEXITY_SCORE = ["claude-3-haiku", "claude-3-sonnet", "claude-3.5-sonnet"]
excluded_tlm_models: List[str] = ["claude-3-sonnet", "claude-3.5-sonnet"]
VALID_TLM_MODELS: List[str] = [
model for model in _VALID_TLM_MODELS if model not in excluded_tlm_models
]
MODELS_WITH_NO_PERPLEXITY_SCORE: List[str] = [
"claude-3-haiku",
"claude-3-sonnet",
"claude-3.5-sonnet",
]
2 changes: 1 addition & 1 deletion tests/tlm/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
)
from tests.tlm.test_prompt import is_tlm_response

test_prompt = make_text_unique(str(TEST_PROMPT))
test_prompt = [make_text_unique(prompt) for prompt in [TEST_PROMPT]][0]
test_prompt_batch = [make_text_unique(prompt) for prompt in TEST_PROMPT_BATCH]


Expand Down

0 comments on commit 293a30b

Please sign in to comment.