mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-01-15 02:47:48 -05:00
fix(yapf): align weird new lines break Signed-off-by: aarnphm-ec2-dev <29749331+aarnphm@users.noreply.github.com>
21 lines
739 B
Python
21 lines
739 B
Python
from __future__ import annotations
|
|
import os
|
|
import typing as t
|
|
|
|
import click
|
|
import inflection
|
|
|
|
import openllm
|
|
|
|
if t.TYPE_CHECKING:
|
|
from openllm_core._typing_compat import DictStrAny
|
|
|
|
def echo(text: t.Any, fg: str = 'green', _with_style: bool = True, **attrs: t.Any) -> None:
|
|
attrs['fg'] = fg if not openllm.utils.get_debug_mode() else None
|
|
if not openllm.utils.get_quiet_mode():
|
|
t.cast(t.Callable[..., None], click.echo if not _with_style else click.secho)(text, **attrs)
|
|
|
|
COLUMNS: int = int(os.environ.get('COLUMNS', str(120)))
|
|
CONTEXT_SETTINGS: DictStrAny = {'help_option_names': ['-h', '--help'], 'max_content_width': COLUMNS, 'token_normalize_func': inflection.underscore}
|
|
__all__ = ['echo', 'COLUMNS', 'CONTEXT_SETTINGS']
|