mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 18:45:00 +00:00
fix: disable usage by default (still experimental) (#929)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
dbb1f86455
commit
28db83e17b
2 changed files with 11 additions and 3 deletions
|
@ -74,8 +74,9 @@ func ModelInference(ctx context.Context, s string, loader *model.ModelLoader, c
|
|||
|
||||
tokenUsage := TokenUsage{}
|
||||
|
||||
// check the per-model feature flag for usage, since tokenCallback may have a cost, but default to on.
|
||||
if !c.FeatureFlag["usage"] {
|
||||
// check the per-model feature flag for usage, since tokenCallback may have a cost.
|
||||
// Defaults to off as for now it is still experimental
|
||||
if c.FeatureFlag.Enabled("usage") {
|
||||
userTokenCallback := tokenCallback
|
||||
if userTokenCallback == nil {
|
||||
userTokenCallback = func(token string, usage TokenUsage) bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue