mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-07 04:45:44 +00:00
Use huggingface_hub inference client for TGI inference
This commit is contained in:
parent
21bedc1596
commit
e5bcfdac21
6 changed files with 179 additions and 142 deletions
|
@ -4,12 +4,15 @@
|
|||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from llama_toolchain.core.datatypes import RemoteProviderConfig
|
||||
from .config import TGIImplConfig
|
||||
|
||||
|
||||
async def get_adapter_impl(config: RemoteProviderConfig, _deps):
|
||||
from .tgi import TGIInferenceAdapter
|
||||
async def get_adapter_impl(config: TGIImplConfig, _deps):
|
||||
from .tgi import TGIAdapter
|
||||
|
||||
impl = TGIInferenceAdapter(config.url)
|
||||
assert isinstance(
|
||||
config, TGIImplConfig
|
||||
), f"Unexpected config type: {type(config)}"
|
||||
impl = TGIAdapter(config)
|
||||
await impl.initialize()
|
||||
return impl
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue