mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +00:00
feat(default): use number of physical cores as default (#2483)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
1ffee9989f
commit
bdd6769b2d
3 changed files with 12 additions and 2 deletions
|
@ -36,3 +36,10 @@ func CPUCapabilities() ([]string, error) {
|
|||
func HasCPUCaps(ids ...cpuid.FeatureID) bool {
|
||||
return cpuid.CPU.Supports(ids...)
|
||||
}
|
||||
|
||||
func CPUPhysicalCores() int {
|
||||
if cpuid.CPU.PhysicalCores == 0 {
|
||||
return 1
|
||||
}
|
||||
return cpuid.CPU.PhysicalCores
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue