【优化】处理 QianWen topP 为空情况

This commit is contained in:
cherishsince 2024-05-24 14:25:00 +08:00
parent a482876113
commit e39513c6b2
2 changed files with 4 additions and 15 deletions

View File

@ -106,7 +106,7 @@ public class QianWenChatClient implements ChatClient, StreamingChatClient {
.messages(messageList)
.maxTokens(chatOptions.getMaxTokens())
.resultFormat(QwenParam.ResultFormat.MESSAGE)
.topP(Double.valueOf(chatOptions.getTopP()))
.topP(chatOptions.getTopP() == null ? null : Double.valueOf(chatOptions.getTopP()))
.topK(chatOptions.getTopK())
.temperature(chatOptions.getTemperature())
// 控制流式输出模式即后面的内容会包含已经输出的内容设置为True将开启增量输出模式后面的输出不会包含已经输出的内容您需要自行拼接整体输出

View File

@ -43,25 +43,14 @@ public class QianWenOptions implements ChatOptions {
return null;
}
// @Override
// public void setTemperature(Float temperature) {
//
// }
//
// @Override
// public void setTopP(Float topP) {
// this.topP = topP;
// }
@Override
public Integer getTopK() {
return null;
}
// @Override
// public void setTopK(Integer topK) {
//
// }
public Float getTopP() {
return topP;
}
@Data
@Accessors