Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Lee <[email protected]>
  • Loading branch information
dave-gray101 committed Oct 16, 2024
1 parent 9eee363 commit 0776abe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion core/http/endpoints/openai/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func downloadFile(url string) (string, error) {
func ImageEndpoint(cl *config.BackendConfigLoader, ml *model.ModelLoader, appConfig *config.ApplicationConfig) func(c *fiber.Ctx) error {
return func(c *fiber.Ctx) error {
input, ok := c.Locals(middleware.CONTEXT_LOCALS_KEY_LOCALAI_REQUEST).(*schema.OpenAIRequest)
log.Warn().Str("input", fmt.Sprintf("%+v", *input)).Msg("TEMP IMAGE TRACE")
if !ok || input.Model == "" {
log.Error().Msg("Image Endpoint - Invalid Input")
return fiber.ErrBadRequest
Expand Down
1 change: 1 addition & 0 deletions core/http/routes/openai.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func RegisterOpenAIRoutes(app *fiber.App,
// images
app.Post("/v1/images/generations",
re.BuildConstantDefaultModelNameMiddleware(model.StableDiffusionBackend),
re.SetModelAndConfig(func() schema.LocalAIRequest { return new(schema.OpenAIRequest) }),
re.SetOpenAIRequest,
openai.ImageEndpoint(cl, ml, appConfig))

Expand Down
4 changes: 3 additions & 1 deletion tests/e2e-aio/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ var _ = Describe("E2E test", func() {
modelName := "jina-reranker-v1-base-en"

req := schema.JINARerankRequest{
Model: modelName,
BasicModelRequest: schema.BasicModelRequest{
Model: modelName,
},
Query: "Organic skincare products for sensitive skin",
Documents: []string{
"Eco-friendly kitchenware for modern homes",
Expand Down

0 comments on commit 0776abe

Please sign in to comment.