Model: Remove Exllamav2 patches
These classes are in the newest version now. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
73a1d9ef78
commit
fc857893ee
1 changed files with 1 additions and 28 deletions
|
|
@ -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 @@ class ExLlamaV2Grammar:
|
|||
):
|
||||
"""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 @@ class ExLlamaV2Grammar:
|
|||
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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue