Skip to content

Commit

Permalink
Merge pull request #170 from macrocosm-os/dev
Browse files Browse the repository at this point in the history
Release 2.7.1.
  • Loading branch information
Sid-Data-Universe authored Dec 19, 2024
2 parents de1346a + 6e162a2 commit 32aba23
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Project Constants.
# ---------------------------------

__version__ = "2.7.0"
__version__ = "2.7.1"
version_split = __version__.split(".")
__spec_version__ = (
(1000 * int(version_split[0]))
Expand Down
4 changes: 2 additions & 2 deletions finetune/eval/if_eval/bullet_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ def __init__(self, count: int):

if count < 1:
raise ValueError(
f"BulletFrequencyRule must expect at least 1 bullet point."
f"BulletFrequencyRule must expect at least 1 '*' bullet point."
)
self.count = count

def get_prompt(self, index: int = -1) -> str:
bullet = "bullet point" if self.count == 1 else "bullet points"
return f"The response must contain exactly {self.count} {bullet} in markdown format."
return f"The response must contain exactly {self.count} '*' {bullet} in markdown format."

def matches(self, text: str, index: int = -1) -> bool:
return (
Expand Down
4 changes: 3 additions & 1 deletion finetune/eval/if_eval/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def __init__(self, keywords: List[str]):
def get_prompt(self, index: int) -> str:
if index >= len(self.keywords):
raise ValueError("Index is out of range for keywords.")
return f'The word "{self.keywords[index]}" must not be the response.'
return (
f'The word "{self.keywords[index]}" must not be included in the response.'
)

def get_keywords(self) -> List[str]:
return self.keywords
Expand Down
4 changes: 2 additions & 2 deletions tests/finetune/eval/if_eval/test_bullet_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ def test_get_prompt_frequency_one(self):
rule = BulletFrequencyRule(count=1)
self.assertEqual(
rule.get_prompt(),
"The response must contain exactly 1 bullet point in markdown format.",
"The response must contain exactly 1 '*' bullet point in markdown format.",
)

def test_get_prompt_frequency_two(self):
rule = BulletFrequencyRule(count=2)
self.assertEqual(
rule.get_prompt(),
"The response must contain exactly 2 bullet points in markdown format.",
"The response must contain exactly 2 '*' bullet points in markdown format.",
)


Expand Down
5 changes: 3 additions & 2 deletions tests/finetune/eval/if_eval/test_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ class TestForbiddenKeyword(unittest.TestCase):
def test_get_prompt(self):
rule = KeywordForbiddenRule(["test", "example"])
self.assertEqual(
rule.get_prompt(0), 'The word "test" must not be the response.'
rule.get_prompt(0), 'The word "test" must not be included in the response.'
)
self.assertEqual(
rule.get_prompt(1), 'The word "example" must not be the response.'
rule.get_prompt(1),
'The word "example" must not be included in the response.',
)

def test_matches(self):
Expand Down

0 comments on commit 32aba23

Please sign in to comment.