Fix unit tests for the frontend language part (#872)

This commit is contained in:
Ying Sheng
2024-08-01 12:39:12 -07:00
committed by GitHub
parent aba6f51f88
commit 6f221d4ca0
11 changed files with 80 additions and 83 deletions

View File

@@ -1,23 +1,19 @@
"""
Usage:
python3 -m sglang.launch_server --model-path meta-llama/Meta-Llama-3-8B-Instruct --port 30000
python3 test_bind_cache.py
"""
import unittest
import sglang as sgl
from sglang.lang.backend.runtime_endpoint import RuntimeEndpoint
class TestBind(unittest.TestCase):
backend = None
def setUp(self):
cls = type(self)
@classmethod
def setUpClass(cls):
cls.backend = sgl.Runtime(model_path="meta-llama/Meta-Llama-3-8B-Instruct")
sgl.set_default_backend(cls.backend)
if cls.backend is None:
cls.backend = RuntimeEndpoint(base_url="http://localhost:30000")
@classmethod
def tearDownClass(cls):
cls.backend.shutdown()
def test_bind(self):
@sgl.function
@@ -54,5 +50,5 @@ if __name__ == "__main__":
unittest.main(warnings="ignore")
# t = TestBind()
# t.setUp()
# t.setUpClass()
# t.test_cache()