Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
indentation
  • Loading branch information
anandrgitnirman committed May 26, 2022
1 parent b265b1d commit 7ce4dc7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
29 changes: 17 additions & 12 deletions training/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
# Model Training


# Model Training

## Model - Lifecycle - CREATE/UPDATE/DELETE/GETDETAILS

### CreateModel
Request to create a model, please note as part of MVP1, there will not be any workflows associated with model request approval

AI consumers , will pass the below details
list of addresses that can access this model ( applicable if model is not public)
is model is public
Description of the model
Request to create a model, please note as part of MVP1, there will not be any workflows associated with model request
approval

AI consumers , will pass the below details list of addresses that can access this model ( applicable if model is not
public)
is model is public Description of the model

In return the AI consumer will get back a model ID

###UpdateModelAccess
AI consumer can add/remove addresses associated with a given model , can also make this public from private and viceversa.
### UpdateModelAccess

AI consumer can add/remove addresses associated with a given model , can also make this public from private and
viceversa.

### DeleteModel

AI consumer had created and can request that the model be deleted.

### GetModelStatus

Pass the model Id and get back the training status of this model

### GetAllAccessibleModels
An AI consumer can always call back this method to determine the list of models associated to a given address , this can be used while making inference calls , the AI consumer can pick the model of their
choice if multiple models are available

An AI consumer can always call back this method to determine the list of models associated to a given address , this can
be used while making inference calls , the AI consumer can pick the model of their choice if multiple models are
available

![](/home/adminaccount/Downloads/trainingflow.png.png)
6 changes: 4 additions & 2 deletions training/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func (service ModelService) getServiceClient() (conn *grpc.ClientConn, client Mo
log.WithError(err).Warningf("unable to connect to grpc endpoint: %v", err)
return nil, nil, err
}
/* */
// create the client instance
client = NewModelClient(conn)
return
Expand Down Expand Up @@ -176,6 +175,9 @@ func (service ModelService) updateModelDetails(request *UpdateModelRequest, resp
data.UpdatedByAddress = request.ModelDetailsRequest.Authorization.SignerAddress
data.Status = string(response.Status)
}
// for all the new address , add the entry
//todo
// for any old address removed , remove the entry

err = service.storage.Put(key, data)
}
Expand Down Expand Up @@ -373,7 +375,7 @@ func (service *ModelService) verifySignature(request *AuthorizationDetails) erro
request.GetSignature(), utils.ToChecksumAddress(request.SignerAddress))
}

//"__methodName", user_address, current_block_number
//"user passed message ", user_address, current_block_number
func (service *ModelService) getMessageBytes(prefixMessage string, request *AuthorizationDetails) []byte {
userAddress := utils.ToChecksumAddress(request.SignerAddress)
message := bytes.Join([][]byte{
Expand Down
10 changes: 5 additions & 5 deletions training/training.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ message AuthorizationDetails {
enum Status {
CREATED = 0;
IN_PROGRESS = 1;
ERROR =2;
ERROR = 2;
COMPLETED = 3;
DELETED = 4;
}
Expand All @@ -48,12 +48,12 @@ message AccessibleModelsRequest {
}

message AccessibleModelsResponse {
repeated ModelDetails list_of_models= 1;
Status status = 2;
repeated ModelDetails list_of_models = 1;
Status status = 2;
}

message ModelDetailsRequest {
ModelDetails model_details =1 ;
ModelDetails model_details = 1 ;
AuthorizationDetails authorization = 2;
}

Expand All @@ -68,7 +68,7 @@ message UpdateModelRequest {

message ModelDetailsResponse {
Status status = 1;
ModelDetails model_details =2;
ModelDetails model_details = 2;
string message = 3;
repeated string address_list = 4;
string service_id = 6;
Expand Down

0 comments on commit 7ce4dc7

Please sign in to comment.