-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata.go
39 lines (31 loc) · 1.12 KB
/
data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
// data module holds all data representations used in our package
//
// Copyright (c) 2023 - Valentin Kuznetsov <[email protected]>
//
// MLTypes defines supported ML data types
var MLTypes = []string{"TensorFlow", "PyTorch", "ScikitLearn"}
// MLBackend represents ML backend engine
type MLBackend struct {
Name string `json:"name"` // ML backend name, e.g. TFaaS
Type string `json:"type"` // ML backebd type, e.g. TensorFlow
URI string `json:"uri"` // ML backend URI, e.g. http://localhost:port
}
// Predict performs predict action on upstream ML backend
func (m *MLBackend) Predict(data []byte) ([]byte, error) {
return []byte{}, nil
}
// Upload performs upload of the given data to upstream ML backend
func (m *MLBackend) Upload(data []byte) error {
return nil
}
// Download downloads ML model from backend server
func (m *MLBackend) Download(model string) ([]byte, error) {
return []byte{}, nil
}
// Delete performs delete action of the ML model on ML backend
func (m *MLBackend) Delete(model string) error {
return nil
}
// MLBackends represents map of ML backends records
type MLBackends map[string]MLBackend