Skip to content

Commit

Permalink
[Core] Stop using outlines.caching.cache
Browse files Browse the repository at this point in the history
This is broken, and the fix in outlines itself was to just stop using
it, so we should do the same.

references:

- dottxt-ai/outlines#1274
- dottxt-ai/outlines#1278

Signed-off-by: Russell Bryant <[email protected]>
  • Loading branch information
russellb committed Dec 2, 2024
1 parent fcdb0ef commit 4dc509f
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import torch
from lark import Lark
from outlines import grammars
from outlines.caching import cache
from outlines.fsm.guide import CFGGuide, Generate, Guide, RegexGuide, Write
from outlines.fsm.json_schema import build_regex_from_schema
from pydantic import BaseModel
Expand Down Expand Up @@ -95,7 +94,6 @@ def __call__(self, input_ids: List[int],
class RegexLogitsProcessor(BaseLogitsProcessor):

@classmethod
@cache()
def _get_guide(cls, regex_string: str,
tokenizer: PreTrainedTokenizerBase) -> Guide:
tokenizer = _adapt_tokenizer(tokenizer)
Expand Down Expand Up @@ -154,7 +152,6 @@ def __init__(self, schema: Union[str, Dict, BaseModel],
class CFGLogitsProcessor(BaseLogitsProcessor):

@classmethod
@cache()
def _get_guide(cls, cfg: str, tokenizer: PreTrainedTokenizerBase) -> Guide:
tokenizer = _adapt_tokenizer(tokenizer)
return CFGGuide(cfg, tokenizer)
Expand Down

0 comments on commit 4dc509f

Please sign in to comment.