-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
feat: update zhipu embedding request to require dimensions and modify… #2334
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,15 +16,21 @@ RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat ./VERSION) npm run buil | |||||||||||
|
|
||||||||||||
| FROM golang:alpine AS builder2 | ||||||||||||
|
|
||||||||||||
| RUN apk add --no-cache \ | ||||||||||||
| gcc \ | ||||||||||||
| musl-dev \ | ||||||||||||
| sqlite-dev \ | ||||||||||||
| build-base | ||||||||||||
|
|
||||||||||||
| ENV GO111MODULE=on \ | ||||||||||||
| CGO_ENABLED=1 \ | ||||||||||||
| GOOS=linux | ||||||||||||
| # 替换为国内源(解决卡住问题) | ||||||||||||
| RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \ | ||||||||||||
| apk add --no-cache gcc musl-dev sqlite-dev build-base | ||||||||||||
|
|
||||||||||||
| # RUN apk add --no-cache \ | ||||||||||||
| # gcc \ | ||||||||||||
| # musl-dev \ | ||||||||||||
| # sqlite-dev \ | ||||||||||||
| # build-base | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+23
to
+28
|
||||||||||||
| # RUN apk add --no-cache \ | |
| # gcc \ | |
| # musl-dev \ | |
| # sqlite-dev \ | |
| # build-base |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -134,9 +134,15 @@ func ConvertEmbeddingRequest(request model.GeneralOpenAIRequest) (*EmbeddingRequ | |||||||||||||||||||||||||||||||||
| if len(inputs) != 1 { | ||||||||||||||||||||||||||||||||||
| return nil, errors.New("invalid input length, zhipu only support one input") | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if request.Dimensions == 0 { | ||||||||||||||||||||||||||||||||||
| return nil, errors.New("dimensions is required for zhipu embedding request") | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| return &EmbeddingRequest{ | ||||||||||||||||||||||||||||||||||
| Model: request.Model, | ||||||||||||||||||||||||||||||||||
| Input: inputs[0], | ||||||||||||||||||||||||||||||||||
| Dimensions: request.Dimensions, | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+138
to
+145
|
||||||||||||||||||||||||||||||||||
| if request.Dimensions == 0 { | |
| return nil, errors.New("dimensions is required for zhipu embedding request") | |
| } | |
| return &EmbeddingRequest{ | |
| Model: request.Model, | |
| Input: inputs[0], | |
| Dimensions: request.Dimensions, | |
| if request.Dimensions == nil { | |
| return nil, errors.New("dimensions is required for zhipu embedding request") | |
| } | |
| return &EmbeddingRequest{ | |
| Model: request.Model, | |
| Input: inputs[0], | |
| Dimensions: *request.Dimensions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Comments in the Dockerfile are in Chinese. For better maintainability in international projects, consider using English comments or providing bilingual documentation.