Skip to content

Commit 6512444

Browse files
authored
Merge pull request #1701 from sunya-ch/model-server-patch-1
fix: format ComponentModelWeights
2 parents a388f0a + d446231 commit 6512444

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: pkg/model/estimator/local/regressor/model_weights.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ limitations under the License.
1616

1717
package regressor
1818

19-
import "errors"
19+
import (
20+
"errors"
21+
"fmt"
22+
)
2023

2124
var (
2225
errModelWeightsInvalid = errors.New("ModelWeights is invalid")
@@ -100,3 +103,10 @@ type ComponentModelWeights struct {
100103
Package *ModelWeights `json:"package,omitempty"`
101104
DRAM *ModelWeights `json:"dram,omitempty"`
102105
}
106+
107+
func (w ComponentModelWeights) String() string {
108+
if w.Platform != nil {
109+
return fmt.Sprintf("%s (platform: %v)", w.ModelName, w.Platform)
110+
}
111+
return fmt.Sprintf("%s (package: %v (core: %v, uncore: %v), dram: %v)", w.ModelName, w.Package, w.Core, w.Uncore, w.DRAM)
112+
}

0 commit comments

Comments
 (0)