Skip to content

Commit

Permalink
more logprobs -> kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
huiwengoh committed Jun 17, 2024
1 parent 711dd49 commit 64e7f0b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cleanlab_studio/studio/trustworthy_language_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ def try_get_trustworthiness_score(
Args:
prompt (Sequence[str]): list of prompts for the TLM to evaluate
response (Sequence[str]): list of existing responses corresponding to the input prompts (from any LLM or human-written)
logprobs (Sequence[float]): list of log probabilities associated with the given responses
Returns:
List[float]: list of floats corresponding to the TLM's trustworthiness score.
The score quantifies how confident TLM is that the given response is good for the given prompt.
Expand All @@ -477,7 +476,7 @@ async def get_trustworthiness_score_async(
self,
prompt: Union[str, Sequence[str]],
response: Union[str, Sequence[str]],
logprobs: Optional[Union[float, Sequence[float]]] = None,
**kwargs: Any,
) -> Union[TLMScoreResponse, List[TLMScoreResponse]]:
"""Asynchronously gets trustworthiness score for prompt-response pairs.
This method is similar to the [`get_trustworthiness_score()`](#method-get_trustworthiness_score) method but operates asynchronously,
Expand All @@ -490,14 +489,13 @@ async def get_trustworthiness_score_async(
Args:
prompt (str | Sequence[str]): prompt (or list of prompts) for the TLM to evaluate
response (str | Sequence[str]): response (or list of responses) corresponding to the input prompts
logprobs (Sequence[float]): list of log probabilities associated with the given responses
Returns:
float | List[float]: float or list of floats (if multiple prompt-responses were provided) corresponding
to the TLM's trustworthiness score.
The score quantifies how confident TLM is that the given response is good for the given prompt.
This method will raise an exception if any errors occur or if you hit a timeout (given a timeout is specified).
"""
# TODO: add validation for logprobs
# TODO: add validation for kwargs
validate_tlm_prompt_response(prompt, response)

async with aiohttp.ClientSession() as session:
Expand Down

0 comments on commit 64e7f0b

Please sign in to comment.