refactor(config): simplify configuration and update start CLI output (#611)

* chore(config): simplify configuration and update start CLI output
handling

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: remove state and message sent after server lifecycle

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: update color stream and refactor reusable logic

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: update documentations and mypy

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
Aaron Pham
2023-11-11 22:36:10 -05:00
committed by GitHub
parent 36559a5ab5
commit 7438005c04
19 changed files with 414 additions and 469 deletions

View File

@@ -28,12 +28,7 @@ def parametrise_local_llm(
pytest.skip(f"'{model}' is not yet supported in framework testing.")
backends: tuple[LiteralBackend, ...] = ('pt',)
for backend, prompt in itertools.product(backends, _PROMPT_MAPPING.keys()):
yield (
prompt,
openllm.Runner(
model, model_id=_MODELING_MAPPING[model], ensure_available=True, backend=backend, init_local=True
),
)
yield prompt, openllm.LLM(_MODELING_MAPPING[model], backend=backend)
def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:

View File

@@ -11,20 +11,20 @@ if t.TYPE_CHECKING:
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS') is not None, reason='Model is too large for CI')
def test_flan_t5_implementation(prompt: str, llm: openllm.LLM[t.Any, t.Any]):
assert llm(prompt)
assert llm.generate(prompt)
assert llm(prompt, temperature=0.8, top_p=0.23)
assert llm.generate(prompt, temperature=0.8, top_p=0.23)
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS') is not None, reason='Model is too large for CI')
def test_opt_implementation(prompt: str, llm: openllm.LLM[t.Any, t.Any]):
assert llm(prompt)
assert llm.generate(prompt)
assert llm(prompt, temperature=0.9, top_k=8)
assert llm.generate(prompt, temperature=0.9, top_k=8)
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS') is not None, reason='Model is too large for CI')
def test_baichuan_implementation(prompt: str, llm: openllm.LLM[t.Any, t.Any]):
assert llm(prompt)
assert llm.generate(prompt)
assert llm(prompt, temperature=0.95)
assert llm.generate(prompt, temperature=0.95)