Skip to content

Commit

Permalink
Merge pull request #10 from GeraudBourdin/main
Browse files Browse the repository at this point in the history
add params: n / presence_penalty / frequency_penalty for vllm self inference support.
  • Loading branch information
GeraudBourdin authored Apr 2, 2024
2 parents 3396ecb + 3c2acdb commit e2fe445
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/MistralClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,19 @@ protected function makeChatCompletionRequest(Messages $messages, array $params,
$return['tool_choice'] = $params['tool_choice'];
}

if (isset($params['n']) && is_int($params['n'])) {
$return['n'] = $params['n'];
}

if (isset($params['presence_penalty']) && is_int($params['presence_penalty']) && $params['presence_penalty'] >= -2 && $params['presence_penalty'] <= 2) {
$return['presence_penalty'] = $params['presence_penalty'];
}

if (isset($params['frequency_penalty']) && is_int($params['frequency_penalty'])) {
$return['frequency_penalty'] = $params['frequency_penalty'];
}


return $return;
}

Expand Down

0 comments on commit e2fe445

Please sign in to comment.