Skip to content

Commit

Permalink
fix: update description for GitHub model from user input (#173)
Browse files Browse the repository at this point in the history
Because

- description should come from a single source (user input)

This commit

- update description for GitHub model from user input parameter
  • Loading branch information
Phelan164 authored Sep 14, 2022
1 parent 516de07 commit 821dab3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func NewHandler(s service.Service, t triton.Triton) modelPB.ModelServiceServer {
}
}

//writeToFp takes in a file pointer and byte array and writes the byte array into the file
//returns error if pointer is nil or error in writing to file
// writeToFp takes in a file pointer and byte array and writes the byte array into the file
// returns error if pointer is nil or error in writing to file
func writeToFp(fp *os.File, data []byte) error {
w := 0
n := len(data)
Expand Down Expand Up @@ -896,12 +896,16 @@ func createGitHubModel(h *handler, ctx context.Context, req *modelPB.CreateModel
Repository: modelConfig.Repository,
HtmlUrl: "https://github.com/" + modelConfig.Repository,
})
description := ""
if req.Model.Description != nil {
description = *req.Model.Description
}
githubModel := datamodel.Model{
ID: req.Model.Id,
ModelDefinitionUid: modelDefinition.UID,
Owner: owner,
Visibility: datamodel.ModelVisibility(visibility),
Description: githubInfo.Description,
Description: description,
Configuration: bModelConfig,
Instances: []datamodel.ModelInstance{},
}
Expand Down

0 comments on commit 821dab3

Please sign in to comment.