Skip to content

Commit

Permalink
fix invalid_request_error in GPT models
Browse files Browse the repository at this point in the history
  • Loading branch information
GaiZhenbiao committed May 7, 2024
1 parent 3f11a48 commit a66696f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/models/OpenAIVision.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,14 @@ def _get_response(self, stream=False):
"top_p": self.top_p,
"n": self.n_choices,
"stream": stream,
"presence_penalty": self.presence_penalty,
"frequency_penalty": self.frequency_penalty,
"max_tokens": self.max_generation_token
}

if self.max_generation_token:
payload["max_tokens"] = self.max_generation_token
if self.presence_penalty:
payload["presence_penalty"] = self.presence_penalty
if self.frequency_penalty:
payload["frequency_penalty"] = self.frequency_penalty
if self.stop_sequence:
payload["stop"] = self.stop_sequence
if self.logit_bias is not None:
Expand Down

0 comments on commit a66696f

Please sign in to comment.