mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
Packaging: Add agnostic method to check version of packages
Some packages such as ExllamaV2 and V3 require specific versions for the latest features. Rather than creating repetitive functions, create an agnostic function to check the installed package and then report to the user to upgrade. This is also sent to requests for loading and unloading, so keep the error short. Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
This commit is contained in:
@@ -44,6 +44,7 @@ from common.gen_logging import (
|
||||
from common.hardware import hardware_supports_flash_attn
|
||||
from common.health import HealthManager
|
||||
from common.multimodal import MultimodalEmbeddingWrapper
|
||||
from common.optional_dependencies import check_package_version
|
||||
from common.sampling import BaseSamplerRequest
|
||||
from common.templating import PromptTemplate, find_prompt_template
|
||||
from common.transformers_utils import HFModel
|
||||
@@ -111,6 +112,9 @@ class ExllamaV2Container(BaseModelContainer):
|
||||
# Create a new instance as a "fake self"
|
||||
self = cls()
|
||||
|
||||
# Make sure ExllamaV2 is up to date
|
||||
check_package_version("exllamav2", "0.3.0")
|
||||
|
||||
# Initialize config
|
||||
self.config = ExLlamaV2Config()
|
||||
self.model_dir = model_directory
|
||||
|
||||
@@ -32,6 +32,7 @@ from common.gen_logging import (
|
||||
from common.hardware import hardware_supports_flash_attn
|
||||
from common.health import HealthManager
|
||||
from common.multimodal import MultimodalEmbeddingWrapper
|
||||
from common.optional_dependencies import check_package_version
|
||||
from common.sampling import BaseSamplerRequest
|
||||
from common.templating import PromptTemplate, find_prompt_template
|
||||
from common.transformers_utils import HFModel
|
||||
@@ -96,6 +97,9 @@ class ExllamaV3Container(BaseModelContainer):
|
||||
|
||||
self = cls()
|
||||
|
||||
# Make sure ExllamaV3 is up to date
|
||||
check_package_version("exllamav3", "0.0.2")
|
||||
|
||||
logger.warning(
|
||||
"ExllamaV3 is currently in an alpha state. "
|
||||
"Please note that all config options may not work."
|
||||
|
||||
Reference in New Issue
Block a user