Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
hnyls2002 committed Jul 30, 2024
1 parent cdcbde5 commit ea06a36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
limitations under the License.
"""

"""Base cache class."""
"""Base tool cache for constrained decoding tools."""

import time


class BaseCache:
class BaseToolCache:
def __init__(self, enable=True):
self.enable = enable
self.reset()
Expand Down
4 changes: 2 additions & 2 deletions python/sglang/srt/constrained/fsm_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"""Cache for the compressed finite state machine."""

from sglang.srt.constrained import RegexGuide, TransformerTokenizer
from sglang.srt.constrained.base_cache import BaseCache
from sglang.srt.constrained.base_tool_cache import BaseToolCache


class FSMCache(BaseCache):
class FSMCache(BaseToolCache):
def __init__(self, tokenizer_path, tokenizer_args_dict, enable=True):
super().__init__(enable=enable)

Expand Down
4 changes: 2 additions & 2 deletions python/sglang/srt/constrained/jump_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
make_byte_level_fsm,
make_deterministic_fsm,
)
from sglang.srt.constrained.base_cache import BaseCache
from sglang.srt.constrained.base_tool_cache import BaseToolCache

IP_REGEX = r"((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)"

Expand Down Expand Up @@ -151,7 +151,7 @@ def is_jump_forward_symbol_state(self, state):
)


class JumpForwardCache(BaseCache):
class JumpForwardCache(BaseToolCache):
def __init__(self):
super().__init__()

Expand Down

0 comments on commit ea06a36

Please sign in to comment.