Skip to content

Commit

Permalink
update claude-2-100k prize
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Oct 1, 2023
1 parent f8cb3d9 commit 1b8919f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions auth/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func CanEnableModel(db *sql.DB, user *User, model string) bool {
return user != nil && user.GetQuota(db) >= 50
case globals.SparkDesk:
return user != nil && user.GetQuota(db) >= 1
case globals.Claude2100k:
return user != nil && user.GetQuota(db) >= 1
default:
return true
}
Expand Down
8 changes: 6 additions & 2 deletions utils/tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ func CountInputToken(model string, v []globals.Message) float32 {
return float32(CountTokenPrice(v, model)) / 1000 * 4.2
case globals.SparkDesk:
return float32(CountTokenPrice(v, model)) / 1000 * 0.36
case globals.Claude2, globals.Claude2100k:
case globals.Claude2:
return 0
case globals.Claude2100k:
return float32(CountTokenPrice(v, model)) / 1000 * 0.008
default:
return 0
}
Expand All @@ -125,8 +127,10 @@ func CountOutputToken(model string, t int) float32 {
return float32(t*GetWeightByModel(model)) / 1000 * 8.6
case globals.SparkDesk:
return float32(t*GetWeightByModel(model)) / 1000 * 0.36
case globals.Claude2, globals.Claude2100k:
case globals.Claude2:
return 0
case globals.Claude2100k:
return float32(t*GetWeightByModel(model)) / 1000 * 0.008
default:
return 0
}
Expand Down

0 comments on commit 1b8919f

Please sign in to comment.