NewModelLoader creates a new ModelLoader instance. LRU eviction is now managed through the WatchDog component.
(system *system.SystemState)
| 87 | // NewModelLoader creates a new ModelLoader instance. |
| 88 | // LRU eviction is now managed through the WatchDog component. |
| 89 | func NewModelLoader(system *system.SystemState) *ModelLoader { |
| 90 | nml := &ModelLoader{ |
| 91 | ModelPath: system.Model.ModelsPath, |
| 92 | store: NewInMemoryModelStore(), |
| 93 | loading: make(map[string]chan struct{}), |
| 94 | externalBackends: make(map[string]string), |
| 95 | lruEvictionMaxRetries: 30, // Default: 30 retries |
| 96 | lruEvictionRetryInterval: 1 * time.Second, // Default: 1 second |
| 97 | backendLogs: NewBackendLogStore(1000), |
| 98 | } |
| 99 | |
| 100 | return nml |
| 101 | } |
| 102 | |
| 103 | // GetLoadingCount returns the number of models currently being loaded |
| 104 | func (ml *ModelLoader) GetLoadingCount() int { |