mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 18:22:41 +00:00
implement embedding generation in supported inference providers
This commit is contained in:
parent
b896be2311
commit
e167e9eb93
16 changed files with 383 additions and 29 deletions
|
|
@ -253,4 +253,9 @@ class TogetherInferenceAdapter(
|
|||
model_id: str,
|
||||
contents: List[InterleavedTextMedia],
|
||||
) -> EmbeddingsResponse:
|
||||
raise NotImplementedError()
|
||||
model = await self.model_store.get_model(model_id)
|
||||
r = self._get_client().embeddings.create(
|
||||
model=model.provider_resource_id, input=contents
|
||||
)
|
||||
embeddings = [item.embedding for item in r.data]
|
||||
return EmbeddingsResponse(embeddings=embeddings)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue