Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused llm infer client #217

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ packages:
config:
interfaces:
Deployer:
opencsg.com/csghub-server/builder/inference:
config:
interfaces:
Client:
opencsg.com/csghub-server/accounting/component:
config:
interfaces:
Expand Down
150 changes: 0 additions & 150 deletions _mocks/opencsg.com/csghub-server/builder/inference/mock_Client.go

This file was deleted.

43 changes: 0 additions & 43 deletions api/handler/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,49 +482,6 @@ func (h *ModelHandler) DelDatasetRelation(ctx *gin.Context) {
httpbase.OK(ctx, nil)
}

// Predict godoc
// @Security ApiKey
// @Summary Invoke model prediction
// @Description invoke model prediction
// @Tags Model
// @Accept json
// @Produce json
// @Param namespace path string true "namespace"
// @Param name path string true "name"
// @Param current_user query string false "current user"
// @Param body body types.ModelPredictReq true "input for model prediction"
// @Success 200 {object} string "OK"
// @Failure 400 {object} types.APIBadRequest "Bad request"
// @Failure 500 {object} types.APIInternalServerError "Internal server error"
// @Router /models/{namespace}/{name}/predict [post]
func (h *ModelHandler) Predict(ctx *gin.Context) {
var req types.ModelPredictReq
namespace, name, err := common.GetNamespaceAndNameFromContext(ctx)
if err != nil {
slog.Error("Bad request format", "error", err)
httpbase.BadRequest(ctx, err.Error())
return
}

if err := ctx.ShouldBindJSON(&req); err != nil {
slog.Error("Bad request format", "error", err)
httpbase.BadRequest(ctx, err.Error())
return
}

req.Name = name
req.Namespace = namespace

resp, err := h.c.Predict(ctx, &req)
if err != nil {
slog.Error("fail to call predict", slog.String("error", err.Error()))
httpbase.ServerError(ctx, err)
return
}

httpbase.OK(ctx, resp)
}

func parseTagReqs(ctx *gin.Context) (tags []types.TagReq) {
tagCategories := ctx.QueryArray("tag_category")
tagNames := ctx.QueryArray("tag_name")
Expand Down
3 changes: 0 additions & 3 deletions api/router/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,6 @@ func createModelRoutes(config *config.Config, apiGroup *gin.RouterGroup, needAPI
modelsGroup.POST("/:namespace/:name/update_downloads", middleware.RepoType(types.ModelRepo), repoCommonHandler.UpdateDownloads)
modelsGroup.PUT("/:namespace/:name/incr_downloads", middleware.RepoType(types.ModelRepo), repoCommonHandler.IncrDownloads)
modelsGroup.POST("/:namespace/:name/upload_file", middleware.RepoType(types.ModelRepo), repoCommonHandler.UploadFile)
// invoke model endpoint to do pediction
modelsGroup.POST("/:namespace/:name/predict", modelHandler.Predict)

modelsGroup.POST("/:namespace/:name/mirror", middleware.RepoType(types.ModelRepo), repoCommonHandler.CreateMirror)
modelsGroup.GET("/:namespace/:name/mirror", middleware.RepoType(types.ModelRepo), repoCommonHandler.GetMirror)
modelsGroup.PUT("/:namespace/:name/mirror", middleware.RepoType(types.ModelRepo), repoCommonHandler.UpdateMirror)
Expand Down
28 changes: 0 additions & 28 deletions builder/inference/client.go

This file was deleted.

6 changes: 0 additions & 6 deletions builder/inference/init.go

This file was deleted.

Loading
Loading