模型参数中模型基本参数默认值
This commit is contained in:
parent
abd613d97a
commit
cae326a598
15
proto/im.go
15
proto/im.go
|
|
@ -41,6 +41,21 @@ type ModelParam struct {
|
|||
TopP float64 `json:"topP"` //取
|
||||
}
|
||||
|
||||
func (m *ModelParam) SetDefaultParams() {
|
||||
if m.Temperature == 0 {
|
||||
m.Temperature = DefaultTemperature
|
||||
}
|
||||
if m.MaxTokens == 0 {
|
||||
m.MaxTokens = DefaultMaxTokens
|
||||
}
|
||||
if m.TopK == 0 {
|
||||
m.TopK = DefaultTopK
|
||||
}
|
||||
if m.TopP == 0 {
|
||||
m.TopP = DefaultTopP
|
||||
}
|
||||
}
|
||||
|
||||
type SessionResponse struct {
|
||||
gorm.Model
|
||||
UserID int `gorm:"column:user_id"` //只能由用户创建
|
||||
|
|
|
|||
|
|
@ -130,3 +130,11 @@ const (
|
|||
SparkContextLength = 6
|
||||
DouBaoContextLength = 6
|
||||
)
|
||||
|
||||
// 模型参数
|
||||
const (
|
||||
DefaultTemperature = 0.5
|
||||
DefaultMaxTokens = 4096
|
||||
DefaultTopK = 0.5
|
||||
DefaultTopP = 0.8
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue