mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-30 15:49:40 +00:00
nit
This commit is contained in:
parent
27a0545f5f
commit
e247849d1b
1 changed files with 3 additions and 5 deletions
|
@ -9,9 +9,8 @@ from typing import AsyncGenerator
|
||||||
|
|
||||||
from llama_models.llama3.api.chat_format import ChatFormat
|
from llama_models.llama3.api.chat_format import ChatFormat
|
||||||
|
|
||||||
from llama_models.llama3.api.datatypes import Message, StopReason
|
from llama_models.llama3.api.datatypes import Message
|
||||||
from llama_models.llama3.api.tokenizer import Tokenizer
|
from llama_models.llama3.api.tokenizer import Tokenizer
|
||||||
from llama_models.sku_list import resolve_model
|
|
||||||
|
|
||||||
from azure.ai.inference.aio import ChatCompletionsClient as ChatCompletionsClientAsync
|
from azure.ai.inference.aio import ChatCompletionsClient as ChatCompletionsClientAsync
|
||||||
from azure.core.credentials import AzureKeyCredential
|
from azure.core.credentials import AzureKeyCredential
|
||||||
|
@ -55,7 +54,7 @@ class AzureAIInferenceAdapter(Inference, ModelsProtocolPrivate):
|
||||||
@property
|
@property
|
||||||
def client(self) -> ChatCompletionsClientAsync:
|
def client(self) -> ChatCompletionsClientAsync:
|
||||||
if self.config.credential is None:
|
if self.config.credential is None:
|
||||||
credential = DefaultAzureCredential()
|
credential = DefaultAzureCredential()
|
||||||
else:
|
else:
|
||||||
credential = AzureKeyCredential(self.config.credential)
|
credential = AzureKeyCredential(self.config.credential)
|
||||||
|
|
||||||
|
@ -68,7 +67,7 @@ class AzureAIInferenceAdapter(Inference, ModelsProtocolPrivate):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
return ChatCompletionsClientAsync(
|
return ChatCompletionsClientAsync(
|
||||||
endpoint=self.config.endpoint,
|
endpoint=self.config.endpoint,
|
||||||
credential=credential,
|
credential=credential,
|
||||||
user_agent="llama-stack",
|
user_agent="llama-stack",
|
||||||
)
|
)
|
||||||
|
@ -98,7 +97,6 @@ class AzureAIInferenceAdapter(Inference, ModelsProtocolPrivate):
|
||||||
|
|
||||||
|
|
||||||
async def list_models(self) -> List[ModelDef]:
|
async def list_models(self) -> List[ModelDef]:
|
||||||
print("Model name: ", self._model_name)
|
|
||||||
if self._model_name is None:
|
if self._model_name is None:
|
||||||
return [
|
return [
|
||||||
ModelDef(identifier=model_name, llama_model=azure_model_id)
|
ModelDef(identifier=model_name, llama_model=azure_model_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue