error handling

This commit is contained in:
Sixian Yi 2025-01-29 23:40:35 -08:00
parent 3816355e1d
commit cf672c74b0

View file

@ -9,7 +9,6 @@ from typing import AsyncGenerator, List, Optional, Union
from llama_models.datatypes import CoreModelId
from llama_models.llama3.api.chat_format import ChatFormat
from llama_models.llama3.api.tokenizer import Tokenizer
from termcolor import cprint
from together import Together
from llama_stack.apis.common.content_types import InterleavedContent
@ -181,9 +180,8 @@ class TogetherInferenceAdapter(
if logprobs and logprobs.top_k:
if logprobs.top_k != 1:
cprint(
"Together only supports logprobs top_k=1. Overriding.",
"Yello",
raise ValueError(
f"Unsupported value: Together only supports logprobs top_k=1. {logprobs.top_k} was provided",
)
options["logprobs"] = 1