-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Feat/qwen minimax tts voice clone #5198
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
Changes from all commits
4a6ad80
e7fdb14
74fd3a0
0ae4096
a7c882f
1c44095
e435519
69a8a8f
a320675
a7b860a
fe38579
d194498
7e65900
42467ba
50b4911
cc477ba
e8be584
95b8ec7
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||||||
| name: Docker Build & Push | ||||||||||
|
|
||||||||||
| on: | ||||||||||
| push: | ||||||||||
| branches: | ||||||||||
| - 'feat/**' | ||||||||||
| - 'fix/**' | ||||||||||
| - 'test/**' | ||||||||||
| - 'main' | ||||||||||
| workflow_dispatch: | ||||||||||
|
|
||||||||||
| env: | ||||||||||
| REGISTRY: ghcr.io | ||||||||||
| IMAGE_NAME: ${{ github.repository }} | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| build: | ||||||||||
| name: Build & push | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| permissions: | ||||||||||
| packages: write | ||||||||||
| contents: read | ||||||||||
|
|
||||||||||
| steps: | ||||||||||
| - name: Check out | ||||||||||
| uses: actions/checkout@v4 | ||||||||||
|
|
||||||||||
| - name: Write VERSION | ||||||||||
| run: echo "${GITHUB_REF##*/}-${GITHUB_SHA::7}" > VERSION | ||||||||||
|
|
||||||||||
| - name: Log in to GHCR | ||||||||||
| uses: docker/login-action@v3 | ||||||||||
| with: | ||||||||||
| registry: ${{ env.REGISTRY }} | ||||||||||
| username: ${{ github.actor }} | ||||||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||||||
|
|
||||||||||
| - name: Set up Docker Buildx | ||||||||||
| uses: docker/setup-buildx-action@v3 | ||||||||||
|
Comment on lines
+38
to
+39
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security: Pin action to SHA hash. The Docker Buildx setup action uses a tag reference ( 🔒 Proposed fix - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
+ uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1As per static analysis hints: unpinned action reference (unpinned-uses). 📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[error] 25-25: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| - name: Extract metadata | ||||||||||
| id: meta | ||||||||||
| uses: docker/metadata-action@v5 | ||||||||||
| with: | ||||||||||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||||||||||
| tags: | | ||||||||||
| type=ref,event=branch | ||||||||||
| type=sha,prefix= | ||||||||||
| type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} | ||||||||||
|
|
||||||||||
| - name: Build & push | ||||||||||
| uses: docker/build-push-action@v6 | ||||||||||
| with: | ||||||||||
| context: . | ||||||||||
| push: true | ||||||||||
| tags: ${{ steps.meta.outputs.tags }} | ||||||||||
| labels: ${{ steps.meta.outputs.labels }} | ||||||||||
| cache-from: type=gha | ||||||||||
| cache-to: type=gha,mode=max | ||||||||||
|
|
||||||||||
| - name: Image digest | ||||||||||
| run: | | ||||||||||
| echo "### Docker Image" >> $GITHUB_STEP_SUMMARY | ||||||||||
| echo '```' >> $GITHUB_STEP_SUMMARY | ||||||||||
| echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY | ||||||||||
| echo '```' >> $GITHUB_STEP_SUMMARY | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,6 +30,17 @@ type AudioRequest struct { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //Stream json.RawMessage `json:"stream,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type AudioVoiceCloneRequest struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Model string `json:"model"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Input json.RawMessage `json:"input,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Text string `json:"text,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VoiceID string `json:"voice_id,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FileID int64 `json:"file_id,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AudioURL string `json:"audio_url,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Metadata json.RawMessage `json:"metadata,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rawText string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func (r *AudioRequest) GetTokenCountMeta() *types.TokenCountMeta { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| meta := &types.TokenCountMeta{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CombineText: r.Input, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -41,6 +52,32 @@ func (r *AudioRequest) GetTokenCountMeta() *types.TokenCountMeta { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return meta | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func (r *AudioVoiceCloneRequest) GetTokenCountMeta() *types.TokenCountMeta { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text := r.Text | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if text == "" && len(r.Input) > 0 { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var input struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Text string `json:"text"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if json.Unmarshal(r.Input, &input) == nil { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text = input.Text | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return &types.TokenCountMeta{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CombineText: text, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TokenType: types.TokenTypeTextNumber, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+55
to
+69
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use Line 61 directly calls 🔧 Proposed fix func (r *AudioVoiceCloneRequest) GetTokenCountMeta() *types.TokenCountMeta {
text := r.Text
if text == "" && len(r.Input) > 0 {
var input struct {
Text string `json:"text"`
}
- if json.Unmarshal(r.Input, &input) == nil {
+ if common.Unmarshal(r.Input, &input) == nil {
text = input.Text
}
}As per coding guidelines: "All JSON marshal/unmarshal operations MUST use wrapper functions from 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func (r *AudioVoiceCloneRequest) IsStream(c *gin.Context) bool { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func (r *AudioVoiceCloneRequest) SetModelName(modelName string) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if modelName != "" { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| r.Model = modelName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func (r *AudioRequest) IsStream(c *gin.Context) bool { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return r.StreamFormat == "sse" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Security: Pin action to SHA hash and disable credential persistence.
The checkout action has two security concerns:
@v4) instead of a SHA hash, creating supply chain attack risk. As per static analysis, pinning to hashes is required by blanket policy.persist-credentials: false, credentials may be exposed through GitHub Actions artifacts.🔒 Proposed security hardening
As per static analysis hints: unpinned action reference (unpinned-uses) and credential persistence through GitHub Actions artifacts (artipacked).
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 18-19: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 19-19: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents