Rename TGI Adapter class

This commit is contained in:
Celina Hanouti 2024-09-09 18:30:34 +02:00
parent eee6c69f46
commit 3d660ad938
2 changed files with 5 additions and 5 deletions

View file

@ -5,19 +5,19 @@
# the root directory of this source tree.
from .config import TGIImplConfig
from .tgi import InferenceEndpointAdapter, LocalTGIAdapter
from .tgi import InferenceEndpointAdapter, TGIAdapter
async def get_adapter_impl(config: TGIImplConfig, _deps):
assert isinstance(config, TGIImplConfig), f"Unexpected config type: {type(config)}"
if config.is_local_tgi():
impl = LocalTGIAdapter(config)
impl = TGIAdapter(config)
elif config.is_inference_endpoint():
impl = InferenceEndpointAdapter(config)
else:
raise ValueError(
"Invalid configuration. Specify either a local URL or Inference Endpoint details."
"Invalid configuration. Specify either an URL or HF Inference Endpoint details (namespace and endpoint name)."
)
await impl.initialize()

View file

@ -30,7 +30,7 @@ HF_SUPPORTED_MODELS = {
}
class LocalTGIAdapter(Inference):
class TGIAdapter(Inference):
def __init__(self, config: TGIImplConfig) -> None:
self.config = config
@ -232,7 +232,7 @@ class LocalTGIAdapter(Inference):
)
class InferenceEndpointAdapter(LocalTGIAdapter):
class InferenceEndpointAdapter(TGIAdapter):
def __init__(self, config: TGIImplConfig) -> None:
super().__init__(config)
self.config.url = f"https://api.endpoints.huggingface.cloud/v2/endpoint/{config.hf_namespace}/{config.hf_endpoint_name}"