[Misc] Clean up python/sglang package structure (#35062)
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
import re
|
||||
from typing import Callable, List, Optional, Union
|
||||
|
||||
from sglang.global_config import global_config
|
||||
from sglang.lang.backend.base_backend import BaseBackend
|
||||
from sglang.lang.choices import ChoicesSamplingMethod, token_length_normalized
|
||||
from sglang.lang.global_config import global_config
|
||||
from sglang.lang.ir import (
|
||||
SglExpr,
|
||||
SglExprList,
|
||||
|
||||
@@ -8,10 +8,10 @@ from typing import Dict, List, Optional, Union
|
||||
import aiohttp
|
||||
import requests
|
||||
|
||||
from sglang.global_config import global_config
|
||||
from sglang.lang.backend.base_backend import BaseBackend
|
||||
from sglang.lang.chat_template import get_chat_template, get_chat_template_by_model_path
|
||||
from sglang.lang.choices import ChoicesDecision, ChoicesSamplingMethod
|
||||
from sglang.lang.global_config import global_config
|
||||
from sglang.lang.interpreter import StreamExecutor
|
||||
from sglang.lang.ir import (
|
||||
REGEX_BOOL,
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
"""Global configuration for the frontend language API."""
|
||||
|
||||
|
||||
class GlobalConfig:
|
||||
"""Store mutable process-wide frontend settings."""
|
||||
|
||||
def __init__(self):
|
||||
# Verbosity level
|
||||
# 0: do not output anything
|
||||
# 2: output final text after every run
|
||||
self.verbosity = 0
|
||||
|
||||
# Default backend of the language
|
||||
self.default_backend = None
|
||||
|
||||
# Output tokenization configs
|
||||
self.skip_special_tokens_in_output = True
|
||||
self.spaces_between_special_tokens_in_out = True
|
||||
|
||||
# Language frontend interpreter optimization configs
|
||||
self.enable_precache_with_tracing = True
|
||||
self.enable_parallel_encoding = True
|
||||
|
||||
|
||||
global_config = GlobalConfig()
|
||||
|
||||
__all__ = ["GlobalConfig", "global_config"]
|
||||
@@ -14,7 +14,7 @@ from typing import Any, Callable, Dict, List, Optional
|
||||
|
||||
import tqdm
|
||||
|
||||
from sglang.global_config import global_config
|
||||
from sglang.lang.global_config import global_config
|
||||
from sglang.lang.ir import (
|
||||
SglCommitLazy,
|
||||
SglConcateAndAppend,
|
||||
|
||||
@@ -5,8 +5,8 @@ import inspect
|
||||
import warnings
|
||||
from typing import List, Optional, Union
|
||||
|
||||
from sglang.global_config import global_config
|
||||
from sglang.lang.choices import ChoicesSamplingMethod
|
||||
from sglang.lang.global_config import global_config
|
||||
|
||||
REGEX_INT = r"[-+]?[0-9]+[ \n]*"
|
||||
REGEX_FLOAT = r"[-+]?[0-9]*\.?[0-9]+[ \n]*"
|
||||
|
||||
Reference in New Issue
Block a user