Misc clean up; Remove the support of jump forward (#4032)
This commit is contained in:
@@ -46,7 +46,6 @@ class TestEBNFConstrained(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
setup_class(cls, "xgrammar", disable_overlap=False)
|
||||
cls.check_jump_forward = False
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
@@ -238,12 +237,5 @@ class TestEBNFConstrained(unittest.TestCase):
|
||||
)
|
||||
|
||||
|
||||
class TestEBNFConstrainedLLGuidance(TestEBNFConstrained):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
setup_class(cls, "llguidance", disable_overlap=False)
|
||||
cls.check_jump_forward = False
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -57,7 +57,6 @@ class TestJSONConstrainedOutlinesBackend(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
setup_class(cls, backend="outlines", disable_overlap=False)
|
||||
cls.check_jump_forward = False
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
@@ -134,26 +133,5 @@ class TestJSONConstrainedOutlinesBackend(unittest.TestCase):
|
||||
list(executor.map(self.run_decode, json_schemas))
|
||||
|
||||
|
||||
class TestJumpForwardOutlinesBackend(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
setup_class(cls, backend="outlines", disable_overlap=True)
|
||||
cls.check_jump_forward = True
|
||||
|
||||
|
||||
class TestJSONConstrainedXGrammarBackend(TestJSONConstrainedOutlinesBackend):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
setup_class(cls, backend="xgrammar", disable_overlap=False)
|
||||
cls.check_jump_forward = False
|
||||
|
||||
|
||||
class TestJSONConstrainedLLGuidanceBackend(TestJSONConstrainedOutlinesBackend):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
setup_class(cls, backend="llguidance", disable_overlap=False)
|
||||
cls.check_jump_forward = False
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -12,7 +12,9 @@ from sglang.test.test_utils import (
|
||||
DEFAULT_MOE_MODEL_NAME_FOR_TEST,
|
||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||
DEFAULT_URL_FOR_TEST,
|
||||
is_in_ci,
|
||||
popen_launch_server,
|
||||
write_github_step_summary,
|
||||
)
|
||||
|
||||
|
||||
@@ -49,6 +51,9 @@ class TestMoEEvalAccuracyLarge(unittest.TestCase):
|
||||
metrics = run_eval(args)
|
||||
self.assertGreater(metrics["score"], 0.62)
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(f"### test_mmlu\n" f'{metrics["score"]=:.4f}\n')
|
||||
|
||||
def test_human_eval(self):
|
||||
args = SimpleNamespace(
|
||||
base_url=self.base_url,
|
||||
@@ -61,6 +66,11 @@ class TestMoEEvalAccuracyLarge(unittest.TestCase):
|
||||
metrics = run_eval(args)
|
||||
self.assertGreater(metrics["score"], 0.40)
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_human_eval\n" f'{metrics["score"]=:.4f}\n'
|
||||
)
|
||||
|
||||
def test_mgsm_en(self):
|
||||
args = SimpleNamespace(
|
||||
base_url=self.base_url,
|
||||
@@ -73,6 +83,11 @@ class TestMoEEvalAccuracyLarge(unittest.TestCase):
|
||||
metrics = run_eval(args)
|
||||
self.assertGreater(metrics["score"], 0.61)
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_mgsm_en\n" f'{metrics["score"]=:.4f}\n'
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -3,8 +3,6 @@ python3 -m unittest test_regex_constrained.TestRegexConstrained.test_regex_gener
|
||||
python3 -m unittest test_regex_constrained.TestRegexConstrained.test_regex_generate_greeting
|
||||
python3 -m unittest test_regex_constrained.TestRegexConstrainedLLGuidance.test_regex_generate_email
|
||||
python3 -m unittest test_regex_constrained.TestRegexConstrainedLLGuidance.test_regex_generate_greeting
|
||||
python3 -m unittest test_regex_constrained.TestJumpForwardLLGuidance.test_regex_generate_email
|
||||
python3 -m unittest test_regex_constrained.TestJumpForwardLLGuidance.test_regex_generate_greeting
|
||||
"""
|
||||
|
||||
import json
|
||||
@@ -47,7 +45,6 @@ class TestRegexConstrained(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
setup_class(cls, "xgrammar", disable_overlap=False)
|
||||
cls.check_jump_forward = False
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
@@ -179,20 +176,6 @@ class TestRegexConstrained(unittest.TestCase):
|
||||
)
|
||||
|
||||
|
||||
class TestJumpForward(TestRegexConstrained):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
setup_class(cls, "xgrammar", disable_overlap=True)
|
||||
cls.check_jump_forward = True
|
||||
|
||||
|
||||
class TestJumpForwardLLGuidance(TestRegexConstrained):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
setup_class(cls, "llguidance", disable_overlap=True)
|
||||
cls.check_jump_forward = True
|
||||
|
||||
|
||||
class TestRegexConstrainedLLGuidance(TestRegexConstrained):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
Reference in New Issue
Block a user