From 47578dbe80feb66b32ed695c76ed6f95101ae155 Mon Sep 17 00:00:00 2001 From: kingbri Date: Sat, 24 Feb 2024 01:19:57 -0500 Subject: [PATCH] Model: Remove Exllamav2 patches These classes are in the newest version now. Signed-off-by: kingbri --- backends/exllamav2/grammar.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/backends/exllamav2/grammar.py b/backends/exllamav2/grammar.py index df2ba8ce..3834c5ff 100644 --- a/backends/exllamav2/grammar.py +++ b/backends/exllamav2/grammar.py @@ -1,19 +1,10 @@ import traceback from exllamav2 import ExLlamaV2, ExLlamaV2Tokenizer from exllamav2.generator import ExLlamaV2Sampler -from exllamav2.generator.filters import ExLlamaV2Filter +from exllamav2.generator.filters import ExLlamaV2Filter, ExLlamaV2PrefixFilter from common.logger import init_logger -# TODO: Remove after new exllama version is released -try: - from exllamav2.generator.filters import ExLlamaV2PrefixFilter - - _exllama_filter_available = True -except ImportError: - _exllama_filter_available = False - - logger = init_logger(__name__) @@ -73,15 +64,6 @@ def add_json_schema_filter( ): """Adds an ExllamaV2 filter based on a JSON schema.""" - if not _exllama_filter_available: - logger.warning( - "ExllamaV2PrefixFilter is not available " - "in the currently installed ExllamaV2 version. " - "Skipping JSON schema parsing." - ) - - return - # Import optional dependencies try: from lmformatenforcer import JsonSchemaParser @@ -129,15 +111,6 @@ def add_ebnf_filter( Possibly replace outlines with an in-house solution in the future. """ - if not _exllama_filter_available: - logger.warning( - "filter_prefer_eos is not available " - "in the currently installed ExllamaV2 version. " - "Skipping EBNF parsing." - ) - - return - try: ebnf_filter = ExLlamaV2EbnfFilter(model, tokenizer, ebnf_string) except ImportError: