mirror of
https://github.com/mudler/LocalAI.git
synced 2026-06-25 00:59:28 -04:00
Compare commits
36 Commits
feat/recon
...
fix/parake
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56c50c4b66 | ||
|
|
9f7c58d69c | ||
|
|
e1994579f8 | ||
|
|
e5620989dd | ||
|
|
fc618dcee6 | ||
|
|
e6042080c0 | ||
|
|
0f3b24436d | ||
|
|
4b6f911835 | ||
|
|
a5e28942a6 | ||
|
|
dba9cd7ca4 | ||
|
|
c93190de50 | ||
|
|
4dbf69f889 | ||
|
|
deb430f3ec | ||
|
|
dd8c8778e2 | ||
|
|
06a7b6cadb | ||
|
|
67c8889866 | ||
|
|
1d49041c85 | ||
|
|
2edc4e25b3 | ||
|
|
7888067914 | ||
|
|
9eedbf537a | ||
|
|
69c16481c8 | ||
|
|
56f8a6623f | ||
|
|
4755d676a3 | ||
|
|
10184b5e28 | ||
|
|
fdf475ec5f | ||
|
|
9d54a599b0 | ||
|
|
63bcbf6c12 | ||
|
|
95b058e1c5 | ||
|
|
f2abcc7503 | ||
|
|
62c99c10b3 | ||
|
|
7226bb9f30 | ||
|
|
569d9bbd9e | ||
|
|
682fb2718c | ||
|
|
20c643e1f6 | ||
|
|
64a4351f3a | ||
|
|
b7d67f5779 |
2
.github/workflows/backend.yml
vendored
2
.github/workflows/backend.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
|||||||
has-merges-singlearch: ${{ steps.set-matrix.outputs['has-merges-singlearch'] }}
|
has-merges-singlearch: ${{ steps.set-matrix.outputs['has-merges-singlearch'] }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
uses: oven-sh/setup-bun@v2
|
uses: oven-sh/setup-bun@v2
|
||||||
|
|||||||
2
.github/workflows/backend_build.yml
vendored
2
.github/workflows/backend_build.yml
vendored
@@ -101,7 +101,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/backend_build_darwin.yml
vendored
2
.github/workflows/backend_build_darwin.yml
vendored
@@ -57,7 +57,7 @@ jobs:
|
|||||||
HOMEBREW_NO_ANALYTICS: '1'
|
HOMEBREW_NO_ANALYTICS: '1'
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/backend_merge.yml
vendored
2
.github/workflows/backend_merge.yml
vendored
@@ -49,7 +49,7 @@ jobs:
|
|||||||
# Sparse checkout: the merge job needs `.github/scripts/` (for the
|
# Sparse checkout: the merge job needs `.github/scripts/` (for the
|
||||||
# keepalive cleanup script) but none of the source tree.
|
# keepalive cleanup script) but none of the source tree.
|
||||||
- name: Checkout (.github/scripts only)
|
- name: Checkout (.github/scripts only)
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
sparse-checkout: |
|
sparse-checkout: |
|
||||||
.github/scripts
|
.github/scripts
|
||||||
|
|||||||
2
.github/workflows/backend_pr.yml
vendored
2
.github/workflows/backend_pr.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
|||||||
has-merges-singlearch: ${{ steps.set-matrix.outputs['has-merges-singlearch'] }}
|
has-merges-singlearch: ${{ steps.set-matrix.outputs['has-merges-singlearch'] }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
uses: oven-sh/setup-bun@v2
|
uses: oven-sh/setup-bun@v2
|
||||||
|
|||||||
2
.github/workflows/base-images.yml
vendored
2
.github/workflows/base-images.yml
vendored
@@ -127,7 +127,7 @@ jobs:
|
|||||||
# the original l4t matrix entry which set skip-drivers: 'true'.
|
# the original l4t matrix entry which set skip-drivers: 'true'.
|
||||||
skip-drivers: 'true'
|
skip-drivers: 'true'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: false
|
submodules: false
|
||||||
- name: Free disk space
|
- name: Free disk space
|
||||||
|
|||||||
6
.github/workflows/build-test.yaml
vendored
6
.github/workflows/build-test.yaml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Configure apt mirror on runner
|
- name: Configure apt mirror on runner
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
bump:
|
bump:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
|
|||||||
4
.github/workflows/bump_deps.yaml
vendored
4
.github/workflows/bump_deps.yaml
vendored
@@ -92,7 +92,7 @@ jobs:
|
|||||||
file: "backend/go/vibevoice-cpp/Makefile"
|
file: "backend/go/vibevoice-cpp/Makefile"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Bump dependencies 🔧
|
- name: Bump dependencies 🔧
|
||||||
id: bump
|
id: bump
|
||||||
run: |
|
run: |
|
||||||
@@ -128,7 +128,7 @@ jobs:
|
|||||||
if: github.repository == 'mudler/LocalAI'
|
if: github.repository == 'mudler/LocalAI'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Bump vLLM cu130 wheel pin 🔧
|
- name: Bump vLLM cu130 wheel pin 🔧
|
||||||
id: bump
|
id: bump
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/bump_docs.yaml
vendored
2
.github/workflows/bump_docs.yaml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
- repository: "mudler/LocalAI"
|
- repository: "mudler/LocalAI"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Bump dependencies 🔧
|
- name: Bump dependencies 🔧
|
||||||
run: |
|
run: |
|
||||||
bash .github/bump_docs.sh ${{ matrix.repository }}
|
bash .github/bump_docs.sh ${{ matrix.repository }}
|
||||||
|
|||||||
2
.github/workflows/checksum_checker.yaml
vendored
2
.github/workflows/checksum_checker.yaml
vendored
@@ -8,7 +8,7 @@ jobs:
|
|||||||
if: github.repository == 'mudler/LocalAI'
|
if: github.repository == 'mudler/LocalAI'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Configure apt mirror on runner
|
- name: Configure apt mirror on runner
|
||||||
uses: ./.github/actions/configure-apt-mirror
|
uses: ./.github/actions/configure-apt-mirror
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
2
.github/workflows/deploy-explorer.yaml
vendored
2
.github/workflows/deploy-explorer.yaml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
|
|||||||
2
.github/workflows/gallery-agent.yaml
vendored
2
.github/workflows/gallery-agent.yaml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/generate_intel_image.yaml
vendored
2
.github/workflows/generate_intel_image.yaml
vendored
@@ -44,7 +44,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@master
|
uses: docker/setup-buildx-action@master
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Cache Intel images
|
- name: Cache Intel images
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7
|
||||||
|
|||||||
2
.github/workflows/gh-pages.yml
vendored
2
.github/workflows/gh-pages.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
HUGO_VERSION: "0.146.3"
|
HUGO_VERSION: "0.146.3"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # needed for enableGitInfo
|
fetch-depth: 0 # needed for enableGitInfo
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|||||||
2
.github/workflows/image_build.yml
vendored
2
.github/workflows/image_build.yml
vendored
@@ -80,7 +80,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Configure apt mirror on runner
|
- name: Configure apt mirror on runner
|
||||||
id: apt_mirror
|
id: apt_mirror
|
||||||
|
|||||||
2
.github/workflows/image_merge.yml
vendored
2
.github/workflows/image_merge.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
# Sparse checkout: needed for .github/scripts/ (the keepalive cleanup
|
# Sparse checkout: needed for .github/scripts/ (the keepalive cleanup
|
||||||
# script). Skips the rest of the source tree.
|
# script). Skips the rest of the source tree.
|
||||||
- name: Checkout (.github/scripts only)
|
- name: Checkout (.github/scripts only)
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
sparse-checkout: |
|
sparse-checkout: |
|
||||||
.github/scripts
|
.github/scripts
|
||||||
|
|||||||
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
golangci-lint:
|
golangci-lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
# Full history so golangci-lint's new-from-merge-base can reach
|
# Full history so golangci-lint's new-from-merge-base can reach
|
||||||
# origin/master and compute the diff against it.
|
# origin/master and compute the diff against it.
|
||||||
|
|||||||
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Configure apt mirror on runner
|
- name: Configure apt mirror on runner
|
||||||
|
|||||||
2
.github/workflows/secscan.yaml
vendored
2
.github/workflows/secscan.yaml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
GO111MODULE: on
|
GO111MODULE: on
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Source
|
- name: Checkout Source
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||||
- name: Run Gosec Security Scanner
|
- name: Run Gosec Security Scanner
|
||||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||||
|
|||||||
86
.github/workflows/test-extra.yml
vendored
86
.github/workflows/test-extra.yml
vendored
@@ -50,7 +50,7 @@ jobs:
|
|||||||
parakeet-cpp: ${{ steps.detect.outputs.parakeet-cpp }}
|
parakeet-cpp: ${{ steps.detect.outputs.parakeet-cpp }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
uses: oven-sh/setup-bun@v2
|
uses: oven-sh/setup-bun@v2
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Clone
|
# - name: Clone
|
||||||
# uses: actions/checkout@v6
|
# uses: actions/checkout@v7
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
# - name: Dependencies
|
# - name: Dependencies
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -113,7 +113,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -137,7 +137,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -158,7 +158,7 @@ jobs:
|
|||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Clone
|
# - name: Clone
|
||||||
# uses: actions/checkout@v6
|
# uses: actions/checkout@v7
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
# - name: Dependencies
|
# - name: Dependencies
|
||||||
@@ -178,7 +178,7 @@ jobs:
|
|||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Clone
|
# - name: Clone
|
||||||
# uses: actions/checkout@v6
|
# uses: actions/checkout@v7
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
# - name: Dependencies
|
# - name: Dependencies
|
||||||
@@ -240,7 +240,7 @@ jobs:
|
|||||||
# sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true
|
# sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true
|
||||||
# df -h
|
# df -h
|
||||||
# - name: Clone
|
# - name: Clone
|
||||||
# uses: actions/checkout@v6
|
# uses: actions/checkout@v7
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
# - name: Dependencies
|
# - name: Dependencies
|
||||||
@@ -265,7 +265,7 @@ jobs:
|
|||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Clone
|
# - name: Clone
|
||||||
# uses: actions/checkout@v6
|
# uses: actions/checkout@v7
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
# - name: Dependencies
|
# - name: Dependencies
|
||||||
@@ -288,7 +288,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -309,7 +309,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -330,7 +330,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -351,7 +351,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -373,7 +373,7 @@ jobs:
|
|||||||
# timeout-minutes: 45
|
# timeout-minutes: 45
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Clone
|
# - name: Clone
|
||||||
# uses: actions/checkout@v6
|
# uses: actions/checkout@v7
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
# - name: Dependencies
|
# - name: Dependencies
|
||||||
@@ -394,7 +394,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -415,7 +415,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -436,7 +436,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -462,7 +462,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -484,7 +484,7 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -513,7 +513,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -530,7 +530,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -552,7 +552,7 @@ jobs:
|
|||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -579,7 +579,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -604,7 +604,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -625,7 +625,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -645,7 +645,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -664,7 +664,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -681,7 +681,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -698,7 +698,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -741,7 +741,7 @@ jobs:
|
|||||||
# timeout-minutes: 90
|
# timeout-minutes: 90
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Clone
|
# - name: Clone
|
||||||
# uses: actions/checkout@v6
|
# uses: actions/checkout@v7
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
# - name: Dependencies
|
# - name: Dependencies
|
||||||
@@ -783,7 +783,7 @@ jobs:
|
|||||||
# timeout-minutes: 90
|
# timeout-minutes: 90
|
||||||
# steps:
|
# steps:
|
||||||
# - name: Clone
|
# - name: Clone
|
||||||
# uses: actions/checkout@v6
|
# uses: actions/checkout@v7
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
# - name: Dependencies
|
# - name: Dependencies
|
||||||
@@ -808,7 +808,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -840,7 +840,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -876,7 +876,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -915,7 +915,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -952,7 +952,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -987,7 +987,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -1013,7 +1013,7 @@ jobs:
|
|||||||
timeout-minutes: 150
|
timeout-minutes: 150
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -1042,7 +1042,7 @@ jobs:
|
|||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -1058,7 +1058,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -1091,7 +1091,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -1114,7 +1114,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
@@ -1140,7 +1140,7 @@ jobs:
|
|||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
|
|||||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
go-version: ['1.26.x']
|
go-version: ['1.26.x']
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Free disk space
|
- name: Free disk space
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
go-version: ['1.26.x']
|
go-version: ['1.26.x']
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup Go ${{ matrix.go-version }}
|
- name: Setup Go ${{ matrix.go-version }}
|
||||||
|
|||||||
2
.github/workflows/tests-aio.yml
vendored
2
.github/workflows/tests-aio.yml
vendored
@@ -62,7 +62,7 @@ jobs:
|
|||||||
sudo rm -rfv build || true
|
sudo rm -rfv build || true
|
||||||
df -h
|
df -h
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Dependencies
|
- name: Dependencies
|
||||||
|
|||||||
2
.github/workflows/tests-e2e.yml
vendored
2
.github/workflows/tests-e2e.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
go-version: ['1.25.x']
|
go-version: ['1.25.x']
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Configure apt mirror on runner
|
- name: Configure apt mirror on runner
|
||||||
|
|||||||
97
.github/workflows/tests-pii-ner-e2e.yml
vendored
Normal file
97
.github/workflows/tests-pii-ner-e2e.yml
vendored
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
---
|
||||||
|
name: 'PII NER tier E2E (live GGUF, CPU)'
|
||||||
|
|
||||||
|
# Runs the real privacy-filter GGUF NER tier end-to-end on CPU — the gap the
|
||||||
|
# hermetic tests/e2e suite cannot cover (it only exercises the in-process
|
||||||
|
# pattern tier). Heavy (builds the C++ backend image + downloads a ~2.7 GB
|
||||||
|
# GGUF), so it is path-filtered on PRs and otherwise runs nightly / on demand.
|
||||||
|
#
|
||||||
|
# This drives the container-level harness (tests/e2e-backends) via
|
||||||
|
# `make test-extra-backend-privacy-filter`: it builds the privacy-filter image,
|
||||||
|
# downloads the model, loads it on CPU, and asserts byte-correct, UTF-8-aligned
|
||||||
|
# TokenClassify spans. The complementary HTTP-path specs in tests/e2e
|
||||||
|
# (e2e_pii_ner_test.go) Skip unless PII_NER_MODEL_GGUF is wired.
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 3 * * *'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- 'backend/cpp/privacy-filter/**'
|
||||||
|
- 'backend/Dockerfile.privacy-filter'
|
||||||
|
- 'core/services/routing/pii/**'
|
||||||
|
- 'core/services/routing/piidetector/**'
|
||||||
|
- 'core/backend/token_classify.go'
|
||||||
|
- 'core/http/endpoints/localai/pii.go'
|
||||||
|
- 'core/schema/pii.go'
|
||||||
|
- 'tests/e2e-backends/**'
|
||||||
|
- 'tests/e2e/e2e_pii_ner_test.go'
|
||||||
|
- 'tests/e2e/e2e_suite_test.go'
|
||||||
|
- '.github/workflows/tests-pii-ner-e2e.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'backend/cpp/privacy-filter/**'
|
||||||
|
- 'backend/Dockerfile.privacy-filter'
|
||||||
|
- 'core/services/routing/pii/**'
|
||||||
|
- 'core/services/routing/piidetector/**'
|
||||||
|
- 'core/backend/token_classify.go'
|
||||||
|
- 'core/http/endpoints/localai/pii.go'
|
||||||
|
- 'core/schema/pii.go'
|
||||||
|
- 'tests/e2e-backends/**'
|
||||||
|
- 'tests/e2e/e2e_pii_ner_test.go'
|
||||||
|
- 'tests/e2e/e2e_suite_test.go'
|
||||||
|
- '.github/workflows/tests-pii-ner-e2e.yml'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ci-tests-pii-ner-e2e-${{ github.event.pull_request.number || github.sha }}-${{ github.repository }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests-pii-ner-e2e:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go-version: ['1.25.x']
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Free disk space
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL || true
|
||||||
|
sudo docker image prune --all --force || true
|
||||||
|
df -h
|
||||||
|
- name: Configure apt mirror on runner
|
||||||
|
uses: ./.github/actions/configure-apt-mirror
|
||||||
|
- name: Setup Go ${{ matrix.go-version }}
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
cache: false
|
||||||
|
- name: Proto Dependencies
|
||||||
|
run: |
|
||||||
|
curl -L -s https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip -o protoc.zip && \
|
||||||
|
unzip -j -d /usr/local/bin protoc.zip bin/protoc && \
|
||||||
|
rm protoc.zip
|
||||||
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
|
||||||
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af
|
||||||
|
PATH="$PATH:$HOME/go/bin" make protogen-go
|
||||||
|
- name: Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y build-essential
|
||||||
|
# Builds local-ai-backend:privacy-filter, downloads the GGUF, loads it on
|
||||||
|
# CPU and runs the token_classify capability spec (byte-offset contract).
|
||||||
|
- name: Run live PII NER backend E2E
|
||||||
|
run: PATH="$PATH:$HOME/go/bin" make test-extra-backend-privacy-filter
|
||||||
|
- name: Setup tmate session if tests fail
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: mxschmitt/action-tmate@v3.23
|
||||||
|
with:
|
||||||
|
detached: true
|
||||||
|
connect-timeout-seconds: 180
|
||||||
|
limit-access-to-actor: true
|
||||||
2
.github/workflows/tests-ui-e2e.yml
vendored
2
.github/workflows/tests-ui-e2e.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
|||||||
go-version: ['1.26.x']
|
go-version: ['1.26.x']
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Configure apt mirror on runner
|
- name: Configure apt mirror on runner
|
||||||
|
|||||||
2
.github/workflows/update_swagger.yaml
vendored
2
.github/workflows/update_swagger.yaml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Configure apt mirror on runner
|
- name: Configure apt mirror on runner
|
||||||
uses: ./.github/actions/configure-apt-mirror
|
uses: ./.github/actions/configure-apt-mirror
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -91,3 +91,6 @@ core/http/react-ui/test-results/
|
|||||||
|
|
||||||
# Local worktrees
|
# Local worktrees
|
||||||
.worktrees/
|
.worktrees/
|
||||||
|
|
||||||
|
# SDD / brainstorm scratch (agent-driven development)
|
||||||
|
.superpowers/
|
||||||
|
|||||||
10
Makefile
10
Makefile
@@ -690,6 +690,16 @@ test-extra-backend-llama-cpp-transcription: docker-build-llama-cpp
|
|||||||
BACKEND_TEST_CTX_SIZE=2048 \
|
BACKEND_TEST_CTX_SIZE=2048 \
|
||||||
$(MAKE) test-extra-backend
|
$(MAKE) test-extra-backend
|
||||||
|
|
||||||
|
## privacy-filter: the PII/NER token-classification backend. Exercises the
|
||||||
|
## TokenClassify RPC and asserts byte-correct, UTF-8-aligned span offsets
|
||||||
|
## against the openai-privacy-filter multilingual GGUF (CPU-runnable, ~50M
|
||||||
|
## active params). This is the live-backend coverage for the PII NER tier.
|
||||||
|
test-extra-backend-privacy-filter: docker-build-privacy-filter
|
||||||
|
BACKEND_IMAGE=local-ai-backend:privacy-filter \
|
||||||
|
BACKEND_TEST_MODEL_URL=https://huggingface.co/LocalAI-io/privacy-filter-multilingual-GGUF/resolve/main/privacy-filter-multilingual-f16.gguf \
|
||||||
|
BACKEND_TEST_CAPS=health,load,token_classify \
|
||||||
|
$(MAKE) test-extra-backend
|
||||||
|
|
||||||
## vllm is resolved from a HuggingFace model id (no file download) and
|
## vllm is resolved from a HuggingFace model id (no file download) and
|
||||||
## exercises Predict + streaming + tool-call extraction via the hermes parser.
|
## exercises Predict + streaming + tool-call extraction via the hermes parser.
|
||||||
## Requires a host CPU with the SIMD instructions the prebuilt vllm CPU
|
## Requires a host CPU with the SIMD instructions the prebuilt vllm CPU
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
IK_LLAMA_VERSION?=6c00e87ac84404af588ad2e65935bd6f079c696f
|
IK_LLAMA_VERSION?=7ccf1d209588962b96eacca325b37e9b3e8faf5e
|
||||||
LLAMA_REPO?=https://github.com/ikawrakow/ik_llama.cpp
|
LLAMA_REPO?=https://github.com/ikawrakow/ik_llama.cpp
|
||||||
|
|
||||||
CMAKE_ARGS?=
|
CMAKE_ARGS?=
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
LLAMA_VERSION?=e475fa2b5f9fb50c3d6fc3e7c6fdf1e004465b62
|
LLAMA_VERSION?=be4a6a63eb2b848e19c277bdcf2bd399e8af76d9
|
||||||
LLAMA_REPO?=https://github.com/ggerganov/llama.cpp
|
LLAMA_REPO?=https://github.com/ggerganov/llama.cpp
|
||||||
|
|
||||||
CMAKE_ARGS?=
|
CMAKE_ARGS?=
|
||||||
|
|||||||
@@ -117,7 +117,8 @@ libgoacestepcpp-custom: CMakeLists.txt cpp/goacestepcpp.cpp cpp/goacestepcpp.h
|
|||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) --target goacestepcpp && \
|
cmake --build . --config Release -j$(JOBS) --target goacestepcpp && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/libgoacestepcpp.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/libgoacestepcpp.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/libgoacestepcpp.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
test: acestep-cpp
|
test: acestep-cpp
|
||||||
@echo "Running acestep-cpp tests..."
|
@echo "Running acestep-cpp tests..."
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -22,7 +23,11 @@ func main() {
|
|||||||
// Get library name from environment variable, default to fallback
|
// Get library name from environment variable, default to fallback
|
||||||
libName := os.Getenv("ACESTEP_LIBRARY")
|
libName := os.Getenv("ACESTEP_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./libgoacestepcpp-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./libgoacestepcpp-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./libgoacestepcpp-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gosd, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
gosd, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ mkdir -p $CURDIR/package/lib
|
|||||||
|
|
||||||
cp -avf $CURDIR/acestep-cpp $CURDIR/package/
|
cp -avf $CURDIR/acestep-cpp $CURDIR/package/
|
||||||
cp -fv $CURDIR/libgoacestepcpp-*.so $CURDIR/package/
|
cp -fv $CURDIR/libgoacestepcpp-*.so $CURDIR/package/
|
||||||
|
cp -fv $CURDIR/libgoacestepcpp-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
# Detect architecture and copy appropriate libraries
|
# Detect architecture and copy appropriate libraries
|
||||||
|
|||||||
@@ -12,9 +12,19 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/libgoacestepcpp-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single library variant (Metal or Accelerate). The goacestepcpp
|
||||||
|
# target is built as a CMake MODULE, which emits a .dylib for a SHARED
|
||||||
|
# build but a .so for a MODULE build on Apple, so prefer .dylib and fall
|
||||||
|
# back to .so.
|
||||||
|
LIBRARY="$CURDIR/libgoacestepcpp-fallback.dylib"
|
||||||
|
if [ ! -e "$LIBRARY" ]; then
|
||||||
|
LIBRARY="$CURDIR/libgoacestepcpp-fallback.so"
|
||||||
|
fi
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/libgoacestepcpp-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/libgoacestepcpp-avx.so ]; then
|
if [ -e $CURDIR/libgoacestepcpp-avx.so ]; then
|
||||||
@@ -36,9 +46,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/libgoacestepcpp-avx512.so"
|
LIBRARY="$CURDIR/libgoacestepcpp-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export ACESTEP_LIBRARY=$LIBRARY
|
export ACESTEP_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# If there is a lib/ld.so, use it
|
# If there is a lib/ld.so, use it
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ libced.so: sources/ced.cpp
|
|||||||
cmake -B sources/ced.cpp/build-shared -S sources/ced.cpp $(CMAKE_ARGS)
|
cmake -B sources/ced.cpp/build-shared -S sources/ced.cpp $(CMAKE_ARGS)
|
||||||
cmake --build sources/ced.cpp/build-shared --config Release -j$(JOBS)
|
cmake --build sources/ced.cpp/build-shared --config Release -j$(JOBS)
|
||||||
cp -fv sources/ced.cpp/build-shared/libced.so* ./ 2>/dev/null || true
|
cp -fv sources/ced.cpp/build-shared/libced.so* ./ 2>/dev/null || true
|
||||||
|
cp -fv sources/ced.cpp/build-shared/libced.dylib ./ 2>/dev/null || true
|
||||||
cp -fv sources/ced.cpp/include/ced_capi.h ./
|
cp -fv sources/ced.cpp/include/ced_capi.h ./
|
||||||
|
|
||||||
ced-grpc: libced.so main.go goced.go
|
ced-grpc: libced.so main.go goced.go
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -27,7 +28,11 @@ type libFunc struct {
|
|||||||
func main() {
|
func main() {
|
||||||
libName := os.Getenv("CED_LIBRARY")
|
libName := os.Getenv("CED_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "libced.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "libced.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "libced.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -15,10 +15,12 @@ mkdir -p "$CURDIR/package/lib"
|
|||||||
cp -avf "$CURDIR/ced-grpc" "$CURDIR/package/"
|
cp -avf "$CURDIR/ced-grpc" "$CURDIR/package/"
|
||||||
cp -avf "$CURDIR/run.sh" "$CURDIR/package/"
|
cp -avf "$CURDIR/run.sh" "$CURDIR/package/"
|
||||||
|
|
||||||
cp -avf "$CURDIR"/libced.so* "$CURDIR/package/lib/" 2>/dev/null || {
|
cp -avf "$CURDIR"/libced.so* "$CURDIR/package/lib/" 2>/dev/null || true
|
||||||
echo "ERROR: libced.so not found in $CURDIR, run 'make' first" >&2
|
cp -avf "$CURDIR"/libced.dylib "$CURDIR/package/lib/" 2>/dev/null || true
|
||||||
|
if ! ls "$CURDIR"/package/lib/libced.* >/dev/null 2>&1; then
|
||||||
|
echo "ERROR: libced shared library not found in $CURDIR, run 'make' first" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
fi
|
||||||
|
|
||||||
if [ -f "/lib64/ld-linux-x86-64.so.2" ]; then
|
if [ -f "/lib64/ld-linux-x86-64.so.2" ]; then
|
||||||
echo "Detected x86_64 architecture, copying x86_64 libraries..."
|
echo "Detected x86_64 architecture, copying x86_64 libraries..."
|
||||||
|
|||||||
@@ -3,7 +3,12 @@ set -e
|
|||||||
|
|
||||||
CURDIR=$(dirname "$(realpath "$0")")
|
CURDIR=$(dirname "$(realpath "$0")")
|
||||||
|
|
||||||
export LD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${LD_LIBRARY_PATH:-}"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
export DYLD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${DYLD_LIBRARY_PATH:-}"
|
||||||
|
export CED_LIBRARY="$CURDIR/lib/libced.dylib"
|
||||||
|
else
|
||||||
|
export LD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${LD_LIBRARY_PATH:-}"
|
||||||
|
fi
|
||||||
|
|
||||||
# If a self-contained ld.so was packaged, route through it so the packaged
|
# If a self-contained ld.so was packaged, route through it so the packaged
|
||||||
# libc / libstdc++ are used instead of the host's (matches the sibling backends).
|
# libc / libstdc++ are used instead of the host's (matches the sibling backends).
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ JOBS?=$(shell nproc --ignore=1)
|
|||||||
|
|
||||||
# CrispASR version (release tag)
|
# CrispASR version (release tag)
|
||||||
CRISPASR_REPO?=https://github.com/CrispStrobe/CrispASR
|
CRISPASR_REPO?=https://github.com/CrispStrobe/CrispASR
|
||||||
CRISPASR_VERSION?=d745bda4386ae0f9d1d2f23fff8ec95d76428221
|
CRISPASR_VERSION?=96b2a6ee31d30389fed8a7ef1a54239b75231ddc
|
||||||
SO_TARGET?=libgocrispasr.so
|
SO_TARGET?=libgocrispasr.so
|
||||||
|
|
||||||
CMAKE_ARGS+=-DBUILD_SHARED_LIBS=OFF
|
CMAKE_ARGS+=-DBUILD_SHARED_LIBS=OFF
|
||||||
@@ -75,7 +75,8 @@ UNAME_S := $(shell uname -s)
|
|||||||
ifeq ($(UNAME_S),Linux)
|
ifeq ($(UNAME_S),Linux)
|
||||||
VARIANT_TARGETS = libgocrispasr-avx.so libgocrispasr-avx2.so libgocrispasr-avx512.so libgocrispasr-fallback.so
|
VARIANT_TARGETS = libgocrispasr-avx.so libgocrispasr-avx2.so libgocrispasr-avx512.so libgocrispasr-fallback.so
|
||||||
else
|
else
|
||||||
VARIANT_TARGETS = libgocrispasr-fallback.so
|
# On non-Linux (e.g., Darwin), build only fallback variant (as a dylib)
|
||||||
|
VARIANT_TARGETS = libgocrispasr-fallback.dylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
crispasr: main.go gocrispasr.go $(VARIANT_TARGETS)
|
crispasr: main.go gocrispasr.go $(VARIANT_TARGETS)
|
||||||
@@ -87,7 +88,7 @@ package: crispasr
|
|||||||
build: package
|
build: package
|
||||||
|
|
||||||
clean: purge
|
clean: purge
|
||||||
rm -rf libgocrispasr*.so package sources/CrispASR crispasr
|
rm -rf libgocrispasr*.so libgocrispasr*.dylib package sources/CrispASR crispasr
|
||||||
|
|
||||||
purge:
|
purge:
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
@@ -118,13 +119,21 @@ libgocrispasr-fallback.so: sources/CrispASR
|
|||||||
SO_TARGET=libgocrispasr-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgocrispasr-custom
|
SO_TARGET=libgocrispasr-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgocrispasr-custom
|
||||||
rm -rfv build*
|
rm -rfv build*
|
||||||
|
|
||||||
|
# Build fallback variant as a dylib (Darwin)
|
||||||
|
libgocrispasr-fallback.dylib: sources/CrispASR
|
||||||
|
$(MAKE) purge
|
||||||
|
$(info ${GREEN}I crispasr build info:fallback (dylib)${RESET})
|
||||||
|
SO_TARGET=libgocrispasr-fallback.dylib CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgocrispasr-custom
|
||||||
|
rm -rfv build*
|
||||||
|
|
||||||
libgocrispasr-custom: CMakeLists.txt cpp/crispasr_shim.cpp cpp/crispasr_shim.h
|
libgocrispasr-custom: CMakeLists.txt cpp/crispasr_shim.cpp cpp/crispasr_shim.h
|
||||||
mkdir -p build-$(SO_TARGET) && \
|
mkdir -p build-$(SO_TARGET) && \
|
||||||
cd build-$(SO_TARGET) && \
|
cd build-$(SO_TARGET) && \
|
||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) && \
|
cmake --build . --config Release -j$(JOBS) && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/libgocrispasr.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/libgocrispasr.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/libgocrispasr.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
test: crispasr
|
test: crispasr
|
||||||
CGO_ENABLED=0 $(GOCMD) test -v ./...
|
CGO_ENABLED=0 $(GOCMD) test -v ./...
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -21,7 +22,11 @@ type LibFuncs struct {
|
|||||||
func main() {
|
func main() {
|
||||||
libName := os.Getenv("CRISPASR_LIBRARY")
|
libName := os.Getenv("CRISPASR_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./libgocrispasr-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./libgocrispasr-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./libgocrispasr-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/crispasr $CURDIR/package/
|
cp -avf $CURDIR/crispasr $CURDIR/package/
|
||||||
cp -fv $CURDIR/libgocrispasr-*.so $CURDIR/package/
|
cp -fv $CURDIR/libgocrispasr-*.so $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -fv $CURDIR/libgocrispasr-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
# Detect architecture and copy appropriate libraries
|
# Detect architecture and copy appropriate libraries
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/libgocrispasr-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single dylib variant (Metal or Accelerate)
|
||||||
|
LIBRARY="$CURDIR/libgocrispasr-fallback.dylib"
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/libgocrispasr-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/libgocrispasr-avx.so ]; then
|
if [ -e $CURDIR/libgocrispasr-avx.so ]; then
|
||||||
@@ -36,9 +40,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/libgocrispasr-avx512.so"
|
LIBRARY="$CURDIR/libgocrispasr-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export CRISPASR_LIBRARY=$LIBRARY
|
export CRISPASR_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# Point piper's espeak-ng phonemizer at the bundled voice data. The variable
|
# Point piper's espeak-ng phonemizer at the bundled voice data. The variable
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ ifeq ($(UNAME_S),Linux)
|
|||||||
VARIANT_TARGETS = libdepthanythingcpp-avx.so libdepthanythingcpp-avx2.so libdepthanythingcpp-avx512.so libdepthanythingcpp-fallback.so
|
VARIANT_TARGETS = libdepthanythingcpp-avx.so libdepthanythingcpp-avx2.so libdepthanythingcpp-avx512.so libdepthanythingcpp-fallback.so
|
||||||
else
|
else
|
||||||
# On non-Linux (e.g., Darwin), build only fallback variant
|
# On non-Linux (e.g., Darwin), build only fallback variant
|
||||||
VARIANT_TARGETS = libdepthanythingcpp-fallback.so
|
VARIANT_TARGETS = libdepthanythingcpp-fallback.dylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
depth-anything-cpp: main.go godepthanythingcpp.go $(VARIANT_TARGETS)
|
depth-anything-cpp: main.go godepthanythingcpp.go $(VARIANT_TARGETS)
|
||||||
@@ -89,7 +89,7 @@ package: depth-anything-cpp
|
|||||||
build: package
|
build: package
|
||||||
|
|
||||||
clean: purge
|
clean: purge
|
||||||
rm -rf libdepthanythingcpp*.so depth-anything-cpp package sources
|
rm -rf libdepthanythingcpp*.so libdepthanythingcpp*.dylib depth-anything-cpp package sources
|
||||||
|
|
||||||
purge:
|
purge:
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
@@ -116,11 +116,19 @@ libdepthanythingcpp-avx512.so: sources/depth-anything.cpp
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Build fallback variant (all platforms)
|
# Build fallback variant (all platforms)
|
||||||
|
ifeq ($(UNAME_S),Darwin)
|
||||||
|
libdepthanythingcpp-fallback.dylib: sources/depth-anything.cpp
|
||||||
|
rm -rfv build-$@
|
||||||
|
$(info ${GREEN}I depth-anything-cpp build info:fallback${RESET})
|
||||||
|
SO_TARGET=$@ CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libdepthanythingcpp-custom
|
||||||
|
rm -rfv build-$@
|
||||||
|
else
|
||||||
libdepthanythingcpp-fallback.so: sources/depth-anything.cpp
|
libdepthanythingcpp-fallback.so: sources/depth-anything.cpp
|
||||||
rm -rfv build-$@
|
rm -rfv build-$@
|
||||||
$(info ${GREEN}I depth-anything-cpp build info:fallback${RESET})
|
$(info ${GREEN}I depth-anything-cpp build info:fallback${RESET})
|
||||||
SO_TARGET=$@ CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libdepthanythingcpp-custom
|
SO_TARGET=$@ CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libdepthanythingcpp-custom
|
||||||
rm -rfv build-$@
|
rm -rfv build-$@
|
||||||
|
endif
|
||||||
|
|
||||||
libdepthanythingcpp-custom: CMakeLists.txt
|
libdepthanythingcpp-custom: CMakeLists.txt
|
||||||
mkdir -p build-$(SO_TARGET) && \
|
mkdir -p build-$(SO_TARGET) && \
|
||||||
@@ -128,7 +136,8 @@ libdepthanythingcpp-custom: CMakeLists.txt
|
|||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) && \
|
cmake --build . --config Release -j$(JOBS) && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/libdepthanything.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/libdepthanything.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/libdepthanything.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
all: depth-anything-cpp package
|
all: depth-anything-cpp package
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -27,7 +28,11 @@ func main() {
|
|||||||
// Get library name from environment variable, default to fallback
|
// Get library name from environment variable, default to fallback
|
||||||
libName := os.Getenv("DEPTHANYTHING_LIBRARY")
|
libName := os.Getenv("DEPTHANYTHING_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./libdepthanythingcpp-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./libdepthanythingcpp-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./libdepthanythingcpp-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
# Create lib directory
|
# Create lib directory
|
||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/libdepthanythingcpp-*.so $CURDIR/package/
|
cp -fv $CURDIR/libdepthanythingcpp-*.so $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -fv $CURDIR/libdepthanythingcpp-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -avf $CURDIR/depth-anything-cpp $CURDIR/package/
|
cp -avf $CURDIR/depth-anything-cpp $CURDIR/package/
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/libdepthanythingcpp-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single dylib variant (Metal or Accelerate)
|
||||||
|
LIBRARY="$CURDIR/libdepthanythingcpp-fallback.dylib"
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/libdepthanythingcpp-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/libdepthanythingcpp-avx.so ]; then
|
if [ -e $CURDIR/libdepthanythingcpp-avx.so ]; then
|
||||||
@@ -36,9 +40,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/libdepthanythingcpp-avx512.so"
|
LIBRARY="$CURDIR/libdepthanythingcpp-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export DEPTHANYTHING_LIBRARY=$LIBRARY
|
export DEPTHANYTHING_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# If there is a lib/ld.so, use it
|
# If there is a lib/ld.so, use it
|
||||||
|
|||||||
@@ -67,8 +67,9 @@ $(LIB_SENTINEL): sources/LocalVQE
|
|||||||
# that the loader picks at runtime. We must build every target — the
|
# that the loader picks at runtime. We must build every target — the
|
||||||
# default `--target localvqe_shared` drops these. CMAKE_LIBRARY_OUTPUT_DIRECTORY
|
# default `--target localvqe_shared` drops these. CMAKE_LIBRARY_OUTPUT_DIRECTORY
|
||||||
# routes all of them into build/bin; copy them out next to the binary.
|
# routes all of them into build/bin; copy them out next to the binary.
|
||||||
cp -P build/bin/liblocalvqe.so* . 2>/dev/null || cp -P build/liblocalvqe.so* .
|
cp -P build/bin/liblocalvqe.so* . 2>/dev/null || cp -P build/bin/liblocalvqe.dylib . 2>/dev/null || cp -P build/liblocalvqe.so* . 2>/dev/null || cp -P build/liblocalvqe.dylib .
|
||||||
cp -P build/bin/libggml*.so* . 2>/dev/null || true
|
cp -P build/bin/libggml*.so* . 2>/dev/null || true
|
||||||
|
cp -P build/bin/libggml*.dylib . 2>/dev/null || true
|
||||||
touch $(LIB_SENTINEL)
|
touch $(LIB_SENTINEL)
|
||||||
|
|
||||||
liblocalvqe.so: $(LIB_SENTINEL)
|
liblocalvqe.so: $(LIB_SENTINEL)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -21,7 +22,11 @@ type LibFuncs struct {
|
|||||||
func main() {
|
func main() {
|
||||||
libName := os.Getenv("LOCALVQE_LIBRARY")
|
libName := os.Getenv("LOCALVQE_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./liblocalvqe.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./liblocalvqe.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./liblocalvqe.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ cp -avf $CURDIR/localvqe $CURDIR/package/
|
|||||||
# liblocalvqe.so* (with SOVERSION symlinks) and the libggml-*.so runtime
|
# liblocalvqe.so* (with SOVERSION symlinks) and the libggml-*.so runtime
|
||||||
# variants — LocalVQE picks the matching CPU variant at load time.
|
# variants — LocalVQE picks the matching CPU variant at load time.
|
||||||
cp -P $CURDIR/liblocalvqe.so* $CURDIR/package/ 2>/dev/null || true
|
cp -P $CURDIR/liblocalvqe.so* $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -P $CURDIR/liblocalvqe.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -P $CURDIR/libggml*.so* $CURDIR/package/ 2>/dev/null || true
|
cp -P $CURDIR/libggml*.so* $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -P $CURDIR/libggml*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
# Detect architecture and copy appropriate libraries
|
# Detect architecture and copy appropriate libraries
|
||||||
|
|||||||
@@ -10,8 +10,19 @@ CURDIR=$(dirname "$(realpath $0)")
|
|||||||
# exec'ing the binary.
|
# exec'ing the binary.
|
||||||
cd "$CURDIR"
|
cd "$CURDIR"
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR:$CURDIR/lib:$LD_LIBRARY_PATH
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
export LOCALVQE_LIBRARY=$CURDIR/liblocalvqe.so
|
# macOS: LocalVQE is built as a SHARED library, so dyld needs the .dylib +
|
||||||
|
# DYLD_LIBRARY_PATH. Prefer .dylib and fall back to .so just in case.
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR:$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
LOCALVQE_LIBRARY=$CURDIR/liblocalvqe.dylib
|
||||||
|
if [ ! -e "$LOCALVQE_LIBRARY" ]; then
|
||||||
|
LOCALVQE_LIBRARY=$CURDIR/liblocalvqe.so
|
||||||
|
fi
|
||||||
|
export LOCALVQE_LIBRARY
|
||||||
|
else
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR:$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
|
export LOCALVQE_LIBRARY=$CURDIR/liblocalvqe.so
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f $CURDIR/lib/ld.so ]; then
|
if [ -f $CURDIR/lib/ld.so ]; then
|
||||||
echo "Using lib/ld.so"
|
echo "Using lib/ld.so"
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ ifeq ($(UNAME_S),Linux)
|
|||||||
VARIANT_TARGETS = liblocateanythingcpp-avx.so liblocateanythingcpp-avx2.so liblocateanythingcpp-avx512.so liblocateanythingcpp-fallback.so
|
VARIANT_TARGETS = liblocateanythingcpp-avx.so liblocateanythingcpp-avx2.so liblocateanythingcpp-avx512.so liblocateanythingcpp-fallback.so
|
||||||
else
|
else
|
||||||
# On non-Linux (e.g., Darwin), build only fallback variant
|
# On non-Linux (e.g., Darwin), build only fallback variant
|
||||||
VARIANT_TARGETS = liblocateanythingcpp-fallback.so
|
VARIANT_TARGETS = liblocateanythingcpp-fallback.dylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
locate-anything-cpp: main.go golocateanythingcpp.go $(VARIANT_TARGETS)
|
locate-anything-cpp: main.go golocateanythingcpp.go $(VARIANT_TARGETS)
|
||||||
@@ -82,7 +82,7 @@ package: locate-anything-cpp
|
|||||||
build: package
|
build: package
|
||||||
|
|
||||||
clean: purge
|
clean: purge
|
||||||
rm -rf liblocateanythingcpp*.so locate-anything-cpp package sources
|
rm -rf liblocateanythingcpp*.so liblocateanythingcpp*.dylib locate-anything-cpp package sources
|
||||||
|
|
||||||
purge:
|
purge:
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
@@ -109,11 +109,19 @@ liblocateanythingcpp-avx512.so: sources/locate-anything.cpp
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Build fallback variant (all platforms)
|
# Build fallback variant (all platforms)
|
||||||
|
ifeq ($(UNAME_S),Darwin)
|
||||||
|
liblocateanythingcpp-fallback.dylib: sources/locate-anything.cpp
|
||||||
|
rm -rfv build-$@
|
||||||
|
$(info ${GREEN}I locate-anything-cpp build info:fallback${RESET})
|
||||||
|
SO_TARGET=$@ CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) liblocateanythingcpp-custom
|
||||||
|
rm -rfv build-$@
|
||||||
|
else
|
||||||
liblocateanythingcpp-fallback.so: sources/locate-anything.cpp
|
liblocateanythingcpp-fallback.so: sources/locate-anything.cpp
|
||||||
rm -rfv build-$@
|
rm -rfv build-$@
|
||||||
$(info ${GREEN}I locate-anything-cpp build info:fallback${RESET})
|
$(info ${GREEN}I locate-anything-cpp build info:fallback${RESET})
|
||||||
SO_TARGET=$@ CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) liblocateanythingcpp-custom
|
SO_TARGET=$@ CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) liblocateanythingcpp-custom
|
||||||
rm -rfv build-$@
|
rm -rfv build-$@
|
||||||
|
endif
|
||||||
|
|
||||||
liblocateanythingcpp-custom: CMakeLists.txt
|
liblocateanythingcpp-custom: CMakeLists.txt
|
||||||
mkdir -p build-$(SO_TARGET) && \
|
mkdir -p build-$(SO_TARGET) && \
|
||||||
@@ -121,7 +129,8 @@ liblocateanythingcpp-custom: CMakeLists.txt
|
|||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) && \
|
cmake --build . --config Release -j$(JOBS) && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/liblocateanythingcpp.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/liblocateanythingcpp.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/liblocateanythingcpp.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
all: locate-anything-cpp package
|
all: locate-anything-cpp package
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -27,7 +28,11 @@ func main() {
|
|||||||
// Get library name from environment variable, default to fallback
|
// Get library name from environment variable, default to fallback
|
||||||
libName := os.Getenv("LOCATEANYTHING_LIBRARY")
|
libName := os.Getenv("LOCATEANYTHING_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./liblocateanythingcpp-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./liblocateanythingcpp-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./liblocateanythingcpp-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
# Create lib directory
|
# Create lib directory
|
||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/liblocateanythingcpp-*.so $CURDIR/package/
|
cp -fv $CURDIR/liblocateanythingcpp-*.so $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -fv $CURDIR/liblocateanythingcpp-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -avf $CURDIR/locate-anything-cpp $CURDIR/package/
|
cp -avf $CURDIR/locate-anything-cpp $CURDIR/package/
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/liblocateanythingcpp-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single dylib variant (Metal or Accelerate)
|
||||||
|
LIBRARY="$CURDIR/liblocateanythingcpp-fallback.dylib"
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/liblocateanythingcpp-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/liblocateanythingcpp-avx.so ]; then
|
if [ -e $CURDIR/liblocateanythingcpp-avx.so ]; then
|
||||||
@@ -36,9 +40,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/liblocateanythingcpp-avx512.so"
|
LIBRARY="$CURDIR/liblocateanythingcpp-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export LOCATEANYTHING_LIBRARY=$LIBRARY
|
export LOCATEANYTHING_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# If there is a lib/ld.so, use it
|
# If there is a lib/ld.so, use it
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ UNAME_S := $(shell uname -s)
|
|||||||
ifeq ($(UNAME_S),Linux)
|
ifeq ($(UNAME_S),Linux)
|
||||||
VARIANT_TARGETS = libgomnivoicecpp-avx.so libgomnivoicecpp-avx2.so libgomnivoicecpp-avx512.so libgomnivoicecpp-fallback.so
|
VARIANT_TARGETS = libgomnivoicecpp-avx.so libgomnivoicecpp-avx2.so libgomnivoicecpp-avx512.so libgomnivoicecpp-fallback.so
|
||||||
else
|
else
|
||||||
VARIANT_TARGETS = libgomnivoicecpp-fallback.so
|
# On non-Linux (e.g., Darwin), build only fallback variant (as a dylib)
|
||||||
|
VARIANT_TARGETS = libgomnivoicecpp-fallback.dylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
omnivoice-cpp: main.go gomnivoicecpp.go $(VARIANT_TARGETS)
|
omnivoice-cpp: main.go gomnivoicecpp.go $(VARIANT_TARGETS)
|
||||||
@@ -77,7 +78,7 @@ package: omnivoice-cpp
|
|||||||
build: package
|
build: package
|
||||||
|
|
||||||
clean: purge
|
clean: purge
|
||||||
rm -rf libgomnivoicecpp*.so package sources/omnivoice.cpp omnivoice-cpp
|
rm -rf libgomnivoicecpp*.so libgomnivoicecpp*.dylib package sources/omnivoice.cpp omnivoice-cpp
|
||||||
|
|
||||||
purge:
|
purge:
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
@@ -106,13 +107,20 @@ libgomnivoicecpp-fallback.so: sources/omnivoice.cpp
|
|||||||
SO_TARGET=libgomnivoicecpp-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgomnivoicecpp-custom
|
SO_TARGET=libgomnivoicecpp-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgomnivoicecpp-custom
|
||||||
rm -rf build-libgomnivoicecpp-fallback.so
|
rm -rf build-libgomnivoicecpp-fallback.so
|
||||||
|
|
||||||
|
# Build fallback variant as a dylib (Darwin)
|
||||||
|
libgomnivoicecpp-fallback.dylib: sources/omnivoice.cpp
|
||||||
|
$(info ${GREEN}I omnivoice-cpp build info:fallback (dylib)${RESET})
|
||||||
|
SO_TARGET=libgomnivoicecpp-fallback.dylib CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgomnivoicecpp-custom
|
||||||
|
rm -rf build-libgomnivoicecpp-fallback.dylib
|
||||||
|
|
||||||
libgomnivoicecpp-custom: CMakeLists.txt cpp/gomnivoicecpp.cpp cpp/gomnivoicecpp.h
|
libgomnivoicecpp-custom: CMakeLists.txt cpp/gomnivoicecpp.cpp cpp/gomnivoicecpp.h
|
||||||
mkdir -p build-$(SO_TARGET) && \
|
mkdir -p build-$(SO_TARGET) && \
|
||||||
cd build-$(SO_TARGET) && \
|
cd build-$(SO_TARGET) && \
|
||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) --target gomnivoicecpp && \
|
cmake --build . --config Release -j$(JOBS) --target gomnivoicecpp && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/libgomnivoicecpp.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/libgomnivoicecpp.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/libgomnivoicecpp.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
test: omnivoice-cpp
|
test: omnivoice-cpp
|
||||||
@echo "Running omnivoice-cpp tests..."
|
@echo "Running omnivoice-cpp tests..."
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -21,7 +22,11 @@ type LibFuncs struct {
|
|||||||
func main() {
|
func main() {
|
||||||
libName := os.Getenv("OMNIVOICE_LIBRARY")
|
libName := os.Getenv("OMNIVOICE_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./libgomnivoicecpp-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./libgomnivoicecpp-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./libgomnivoicecpp-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/omnivoice-cpp $CURDIR/package/
|
cp -avf $CURDIR/omnivoice-cpp $CURDIR/package/
|
||||||
cp -fv $CURDIR/libgomnivoicecpp-*.so $CURDIR/package/
|
cp -fv $CURDIR/libgomnivoicecpp-*.so $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -fv $CURDIR/libgomnivoicecpp-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
# Detect architecture and copy appropriate libraries
|
# Detect architecture and copy appropriate libraries
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/libgomnivoicecpp-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single dylib variant (Metal or Accelerate)
|
||||||
|
LIBRARY="$CURDIR/libgomnivoicecpp-fallback.dylib"
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/libgomnivoicecpp-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/libgomnivoicecpp-avx.so ]; then
|
if [ -e $CURDIR/libgomnivoicecpp-avx.so ]; then
|
||||||
@@ -36,9 +40,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/libgomnivoicecpp-avx512.so"
|
LIBRARY="$CURDIR/libgomnivoicecpp-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export OMNIVOICE_LIBRARY=$LIBRARY
|
export OMNIVOICE_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# If there is a lib/ld.so, use it
|
# If there is a lib/ld.so, use it
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# parakeet-cpp backend Makefile.
|
# parakeet-cpp backend Makefile.
|
||||||
#
|
#
|
||||||
# Upstream pin lives below as PARAKEET_VERSION?=db755a78d39f789bb7d4e3935158a9e8105dbe36
|
# Upstream pin lives below as PARAKEET_VERSION?=89f5e2977b4d8bccd45e7bcc6f2ef7c4ed49e89a
|
||||||
# (.github/bump_deps.sh) can find and update it - matches the
|
# (.github/bump_deps.sh) can find and update it - matches the
|
||||||
# whisper.cpp / ds4 / vibevoice-cpp convention.
|
# whisper.cpp / ds4 / vibevoice-cpp convention.
|
||||||
#
|
#
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
# That's what the L0 smoke test uses. The default target below does the
|
# That's what the L0 smoke test uses. The default target below does the
|
||||||
# proper clone-at-pin + cmake build so CI doesn't need a side-checkout.
|
# proper clone-at-pin + cmake build so CI doesn't need a side-checkout.
|
||||||
|
|
||||||
PARAKEET_VERSION?=db755a78d39f789bb7d4e3935158a9e8105dbe36
|
PARAKEET_VERSION?=89f5e2977b4d8bccd45e7bcc6f2ef7c4ed49e89a
|
||||||
PARAKEET_REPO?=https://github.com/mudler/parakeet.cpp
|
PARAKEET_REPO?=https://github.com/mudler/parakeet.cpp
|
||||||
|
|
||||||
GOCMD?=go
|
GOCMD?=go
|
||||||
@@ -74,6 +74,7 @@ libparakeet.so: sources/parakeet.cpp
|
|||||||
cmake -B sources/parakeet.cpp/build-shared -S sources/parakeet.cpp $(CMAKE_ARGS)
|
cmake -B sources/parakeet.cpp/build-shared -S sources/parakeet.cpp $(CMAKE_ARGS)
|
||||||
cmake --build sources/parakeet.cpp/build-shared --config Release -j$(JOBS)
|
cmake --build sources/parakeet.cpp/build-shared --config Release -j$(JOBS)
|
||||||
cp -fv sources/parakeet.cpp/build-shared/libparakeet.so* ./ 2>/dev/null || true
|
cp -fv sources/parakeet.cpp/build-shared/libparakeet.so* ./ 2>/dev/null || true
|
||||||
|
cp -fv sources/parakeet.cpp/build-shared/libparakeet.dylib ./ 2>/dev/null || true
|
||||||
cp -fv sources/parakeet.cpp/include/parakeet_capi.h ./
|
cp -fv sources/parakeet.cpp/include/parakeet_capi.h ./
|
||||||
|
|
||||||
parakeet-cpp-grpc: libparakeet.so main.go goparakeetcpp.go
|
parakeet-cpp-grpc: libparakeet.so main.go goparakeetcpp.go
|
||||||
|
|||||||
@@ -2,15 +2,17 @@ package main
|
|||||||
|
|
||||||
// Started internally by LocalAI - one gRPC server per loaded model.
|
// Started internally by LocalAI - one gRPC server per loaded model.
|
||||||
//
|
//
|
||||||
// Loads libparakeet.so via purego and registers the flat C-API entry
|
// Loads the parakeet shared library via purego and registers the flat
|
||||||
// points declared in parakeet_capi.h. The library name can be overridden
|
// C-API entry points declared in parakeet_capi.h. The library name can be
|
||||||
// with PARAKEET_LIBRARY (mirrors the WHISPER_LIBRARY / VIBEVOICECPP_LIBRARY
|
// overridden with PARAKEET_LIBRARY (mirrors the WHISPER_LIBRARY /
|
||||||
// convention in the sibling backends); the default looks for the .so next
|
// VIBEVOICECPP_LIBRARY convention in the sibling backends); the default
|
||||||
// to this binary.
|
// looks next to this binary for libparakeet.so on Linux and
|
||||||
|
// libparakeet.dylib on macOS.
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -28,7 +30,11 @@ type LibFuncs struct {
|
|||||||
func main() {
|
func main() {
|
||||||
libName := os.Getenv("PARAKEET_LIBRARY")
|
libName := os.Getenv("PARAKEET_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "libparakeet.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "libparakeet.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "libparakeet.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -16,12 +16,15 @@ mkdir -p "$CURDIR/package/lib"
|
|||||||
cp -avf "$CURDIR/parakeet-cpp-grpc" "$CURDIR/package/"
|
cp -avf "$CURDIR/parakeet-cpp-grpc" "$CURDIR/package/"
|
||||||
cp -avf "$CURDIR/run.sh" "$CURDIR/package/"
|
cp -avf "$CURDIR/run.sh" "$CURDIR/package/"
|
||||||
|
|
||||||
# libparakeet.so + any soname symlinks (libparakeet.so.X[.Y]). purego.Dlopen
|
# libparakeet shared lib + any soname symlinks. On Linux this is
|
||||||
# resolves it via LD_LIBRARY_PATH, which run.sh points at lib/.
|
# libparakeet.so[.X.Y]; on macOS it is libparakeet.dylib. purego.Dlopen
|
||||||
cp -avf "$CURDIR"/libparakeet.so* "$CURDIR/package/lib/" 2>/dev/null || {
|
# resolves it via the *_LIBRARY_PATH that run.sh points at lib/.
|
||||||
echo "ERROR: libparakeet.so not found in $CURDIR, run 'make' first" >&2
|
cp -avf "$CURDIR"/libparakeet.so* "$CURDIR/package/lib/" 2>/dev/null || true
|
||||||
|
cp -avf "$CURDIR"/libparakeet.dylib "$CURDIR/package/lib/" 2>/dev/null || true
|
||||||
|
if ! ls "$CURDIR"/package/lib/libparakeet.* >/dev/null 2>&1; then
|
||||||
|
echo "ERROR: libparakeet shared library not found in $CURDIR, run 'make' first" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
fi
|
||||||
|
|
||||||
# Detect architecture and copy the core runtime libs libparakeet.so links
|
# Detect architecture and copy the core runtime libs libparakeet.so links
|
||||||
# against, plus the matching dynamic loader as lib/ld.so.
|
# against, plus the matching dynamic loader as lib/ld.so.
|
||||||
@@ -48,7 +51,7 @@ elif [ -f "/lib/ld-linux-aarch64.so.1" ]; then
|
|||||||
cp -arfLv /lib/aarch64-linux-gnu/librt.so.1 "$CURDIR/package/lib/librt.so.1"
|
cp -arfLv /lib/aarch64-linux-gnu/librt.so.1 "$CURDIR/package/lib/librt.so.1"
|
||||||
cp -arfLv /lib/aarch64-linux-gnu/libpthread.so.0 "$CURDIR/package/lib/libpthread.so.0"
|
cp -arfLv /lib/aarch64-linux-gnu/libpthread.so.0 "$CURDIR/package/lib/libpthread.so.0"
|
||||||
elif [ "$(uname -s)" = "Darwin" ]; then
|
elif [ "$(uname -s)" = "Darwin" ]; then
|
||||||
echo "Detected Darwin"
|
echo "Detected Darwin — system frameworks linked dynamically, no bundled libs needed"
|
||||||
else
|
else
|
||||||
echo "Error: Could not detect architecture"
|
echo "Error: Could not detect architecture"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -3,11 +3,17 @@ set -e
|
|||||||
|
|
||||||
CURDIR=$(dirname "$(realpath "$0")")
|
CURDIR=$(dirname "$(realpath "$0")")
|
||||||
|
|
||||||
export LD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${LD_LIBRARY_PATH:-}"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
export DYLD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${DYLD_LIBRARY_PATH:-}"
|
||||||
|
export PARAKEET_LIBRARY="$CURDIR/lib/libparakeet.dylib"
|
||||||
|
else
|
||||||
|
export LD_LIBRARY_PATH="$CURDIR/lib:$CURDIR:${LD_LIBRARY_PATH:-}"
|
||||||
|
export PARAKEET_LIBRARY="$CURDIR/lib/libparakeet.so"
|
||||||
|
fi
|
||||||
|
|
||||||
# If a self-contained ld.so was packaged, route through it so the
|
# If a self-contained ld.so was packaged, route through it so the
|
||||||
# packaged libc / libstdc++ are used instead of the host's (matches the
|
# packaged libc / libstdc++ are used instead of the host's (matches the
|
||||||
# whisper backend's runtime layout).
|
# whisper backend's runtime layout). Linux only.
|
||||||
if [ -f "$CURDIR/lib/ld.so" ]; then
|
if [ -f "$CURDIR/lib/ld.so" ]; then
|
||||||
echo "Using lib/ld.so"
|
echo "Using lib/ld.so"
|
||||||
exec "$CURDIR/lib/ld.so" "$CURDIR/parakeet-cpp-grpc" "$@"
|
exec "$CURDIR/lib/ld.so" "$CURDIR/parakeet-cpp-grpc" "$@"
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ UNAME_S := $(shell uname -s)
|
|||||||
ifeq ($(UNAME_S),Linux)
|
ifeq ($(UNAME_S),Linux)
|
||||||
VARIANT_TARGETS = libgoqwen3ttscpp-avx.so libgoqwen3ttscpp-avx2.so libgoqwen3ttscpp-avx512.so libgoqwen3ttscpp-fallback.so
|
VARIANT_TARGETS = libgoqwen3ttscpp-avx.so libgoqwen3ttscpp-avx2.so libgoqwen3ttscpp-avx512.so libgoqwen3ttscpp-fallback.so
|
||||||
else
|
else
|
||||||
# On non-Linux (e.g., Darwin), build only fallback variant
|
# On non-Linux (e.g., Darwin), build only fallback variant (as a dylib)
|
||||||
VARIANT_TARGETS = libgoqwen3ttscpp-fallback.so
|
VARIANT_TARGETS = libgoqwen3ttscpp-fallback.dylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
qwen3-tts-cpp: main.go goqwen3ttscpp.go $(VARIANT_TARGETS)
|
qwen3-tts-cpp: main.go goqwen3ttscpp.go $(VARIANT_TARGETS)
|
||||||
@@ -78,7 +78,7 @@ package: qwen3-tts-cpp
|
|||||||
build: package
|
build: package
|
||||||
|
|
||||||
clean: purge
|
clean: purge
|
||||||
rm -rf libgoqwen3ttscpp*.so package sources/qwentts.cpp qwen3-tts-cpp
|
rm -rf libgoqwen3ttscpp*.so libgoqwen3ttscpp*.dylib package sources/qwentts.cpp qwen3-tts-cpp
|
||||||
|
|
||||||
purge:
|
purge:
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
@@ -110,13 +110,20 @@ libgoqwen3ttscpp-fallback.so: sources/qwentts.cpp
|
|||||||
SO_TARGET=libgoqwen3ttscpp-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgoqwen3ttscpp-custom
|
SO_TARGET=libgoqwen3ttscpp-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgoqwen3ttscpp-custom
|
||||||
rm -rf build-libgoqwen3ttscpp-fallback.so
|
rm -rf build-libgoqwen3ttscpp-fallback.so
|
||||||
|
|
||||||
|
# Build fallback variant as a dylib (Darwin)
|
||||||
|
libgoqwen3ttscpp-fallback.dylib: sources/qwentts.cpp
|
||||||
|
$(info ${GREEN}I qwen3-tts-cpp build info:fallback (dylib)${RESET})
|
||||||
|
SO_TARGET=libgoqwen3ttscpp-fallback.dylib CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgoqwen3ttscpp-custom
|
||||||
|
rm -rf build-libgoqwen3ttscpp-fallback.dylib
|
||||||
|
|
||||||
libgoqwen3ttscpp-custom: CMakeLists.txt cpp/goqwen3ttscpp.cpp cpp/goqwen3ttscpp.h
|
libgoqwen3ttscpp-custom: CMakeLists.txt cpp/goqwen3ttscpp.cpp cpp/goqwen3ttscpp.h
|
||||||
mkdir -p build-$(SO_TARGET) && \
|
mkdir -p build-$(SO_TARGET) && \
|
||||||
cd build-$(SO_TARGET) && \
|
cd build-$(SO_TARGET) && \
|
||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) --target goqwen3ttscpp && \
|
cmake --build . --config Release -j$(JOBS) --target goqwen3ttscpp && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/libgoqwen3ttscpp.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/libgoqwen3ttscpp.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/libgoqwen3ttscpp.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
test: qwen3-tts-cpp
|
test: qwen3-tts-cpp
|
||||||
@echo "Running qwen3-tts-cpp tests..."
|
@echo "Running qwen3-tts-cpp tests..."
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -21,7 +22,11 @@ type LibFuncs struct {
|
|||||||
func main() {
|
func main() {
|
||||||
libName := os.Getenv("QWEN3TTS_LIBRARY")
|
libName := os.Getenv("QWEN3TTS_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./libgoqwen3ttscpp-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./libgoqwen3ttscpp-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./libgoqwen3ttscpp-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/qwen3-tts-cpp $CURDIR/package/
|
cp -avf $CURDIR/qwen3-tts-cpp $CURDIR/package/
|
||||||
cp -fv $CURDIR/libgoqwen3ttscpp-*.so $CURDIR/package/
|
cp -fv $CURDIR/libgoqwen3ttscpp-*.so $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -fv $CURDIR/libgoqwen3ttscpp-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
# Detect architecture and copy appropriate libraries
|
# Detect architecture and copy appropriate libraries
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/libgoqwen3ttscpp-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single dylib variant (Metal or Accelerate)
|
||||||
|
LIBRARY="$CURDIR/libgoqwen3ttscpp-fallback.dylib"
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/libgoqwen3ttscpp-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/libgoqwen3ttscpp-avx.so ]; then
|
if [ -e $CURDIR/libgoqwen3ttscpp-avx.so ]; then
|
||||||
@@ -36,9 +40,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/libgoqwen3ttscpp-avx512.so"
|
LIBRARY="$CURDIR/libgoqwen3ttscpp-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export QWEN3TTS_LIBRARY=$LIBRARY
|
export QWEN3TTS_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# If there is a lib/ld.so, use it
|
# If there is a lib/ld.so, use it
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ ifeq ($(UNAME_S),Linux)
|
|||||||
VARIANT_TARGETS = librfdetrcpp-avx.so librfdetrcpp-avx2.so librfdetrcpp-avx512.so librfdetrcpp-fallback.so
|
VARIANT_TARGETS = librfdetrcpp-avx.so librfdetrcpp-avx2.so librfdetrcpp-avx512.so librfdetrcpp-fallback.so
|
||||||
else
|
else
|
||||||
# On non-Linux (e.g., Darwin), build only fallback variant
|
# On non-Linux (e.g., Darwin), build only fallback variant
|
||||||
VARIANT_TARGETS = librfdetrcpp-fallback.so
|
VARIANT_TARGETS = librfdetrcpp-fallback.dylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
rfdetr-cpp: main.go gorfdetrcpp.go $(VARIANT_TARGETS)
|
rfdetr-cpp: main.go gorfdetrcpp.go $(VARIANT_TARGETS)
|
||||||
@@ -83,7 +83,7 @@ package: rfdetr-cpp
|
|||||||
build: package
|
build: package
|
||||||
|
|
||||||
clean: purge
|
clean: purge
|
||||||
rm -rf librfdetrcpp*.so rfdetr-cpp package sources
|
rm -rf librfdetrcpp*.so librfdetrcpp*.dylib rfdetr-cpp package sources
|
||||||
|
|
||||||
purge:
|
purge:
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
@@ -110,11 +110,19 @@ librfdetrcpp-avx512.so: sources/rt-detr.cpp
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Build fallback variant (all platforms)
|
# Build fallback variant (all platforms)
|
||||||
|
ifeq ($(UNAME_S),Darwin)
|
||||||
|
librfdetrcpp-fallback.dylib: sources/rt-detr.cpp
|
||||||
|
rm -rfv build-$@
|
||||||
|
$(info ${GREEN}I rfdetr-cpp build info:fallback${RESET})
|
||||||
|
SO_TARGET=$@ CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) librfdetrcpp-custom
|
||||||
|
rm -rfv build-$@
|
||||||
|
else
|
||||||
librfdetrcpp-fallback.so: sources/rt-detr.cpp
|
librfdetrcpp-fallback.so: sources/rt-detr.cpp
|
||||||
rm -rfv build-$@
|
rm -rfv build-$@
|
||||||
$(info ${GREEN}I rfdetr-cpp build info:fallback${RESET})
|
$(info ${GREEN}I rfdetr-cpp build info:fallback${RESET})
|
||||||
SO_TARGET=$@ CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) librfdetrcpp-custom
|
SO_TARGET=$@ CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) librfdetrcpp-custom
|
||||||
rm -rfv build-$@
|
rm -rfv build-$@
|
||||||
|
endif
|
||||||
|
|
||||||
librfdetrcpp-custom: CMakeLists.txt
|
librfdetrcpp-custom: CMakeLists.txt
|
||||||
mkdir -p build-$(SO_TARGET) && \
|
mkdir -p build-$(SO_TARGET) && \
|
||||||
@@ -122,7 +130,8 @@ librfdetrcpp-custom: CMakeLists.txt
|
|||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) && \
|
cmake --build . --config Release -j$(JOBS) && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/librfdetrcpp.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/librfdetrcpp.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/librfdetrcpp.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
all: rfdetr-cpp package
|
all: rfdetr-cpp package
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -27,7 +28,11 @@ func main() {
|
|||||||
// Get library name from environment variable, default to fallback
|
// Get library name from environment variable, default to fallback
|
||||||
libName := os.Getenv("RFDETR_LIBRARY")
|
libName := os.Getenv("RFDETR_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./librfdetrcpp-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./librfdetrcpp-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./librfdetrcpp-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rfdetrLib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
rfdetrLib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
# Create lib directory
|
# Create lib directory
|
||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/librfdetrcpp-*.so $CURDIR/package/
|
cp -fv $CURDIR/librfdetrcpp-*.so $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -fv $CURDIR/librfdetrcpp-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -avf $CURDIR/rfdetr-cpp $CURDIR/package/
|
cp -avf $CURDIR/rfdetr-cpp $CURDIR/package/
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/librfdetrcpp-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single dylib variant (Metal or Accelerate)
|
||||||
|
LIBRARY="$CURDIR/librfdetrcpp-fallback.dylib"
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/librfdetrcpp-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/librfdetrcpp-avx.so ]; then
|
if [ -e $CURDIR/librfdetrcpp-avx.so ]; then
|
||||||
@@ -36,9 +40,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/librfdetrcpp-avx512.so"
|
LIBRARY="$CURDIR/librfdetrcpp-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export RFDETR_LIBRARY=$LIBRARY
|
export RFDETR_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# If there is a lib/ld.so, use it
|
# If there is a lib/ld.so, use it
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ ifeq ($(UNAME_S),Linux)
|
|||||||
VARIANT_TARGETS = libgosam3-avx.so libgosam3-avx2.so libgosam3-avx512.so libgosam3-fallback.so
|
VARIANT_TARGETS = libgosam3-avx.so libgosam3-avx2.so libgosam3-avx512.so libgosam3-fallback.so
|
||||||
else
|
else
|
||||||
# On non-Linux (e.g., Darwin), build only fallback variant
|
# On non-Linux (e.g., Darwin), build only fallback variant
|
||||||
VARIANT_TARGETS = libgosam3-fallback.so
|
VARIANT_TARGETS = libgosam3-fallback.dylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
sam3-cpp: main.go gosam3.go $(VARIANT_TARGETS)
|
sam3-cpp: main.go gosam3.go $(VARIANT_TARGETS)
|
||||||
@@ -78,7 +78,7 @@ package: sam3-cpp
|
|||||||
build: package
|
build: package
|
||||||
|
|
||||||
clean: purge
|
clean: purge
|
||||||
rm -rf libgosam3*.so sam3-cpp package sources
|
rm -rf libgosam3*.so libgosam3*.dylib sam3-cpp package sources
|
||||||
|
|
||||||
purge:
|
purge:
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
@@ -105,11 +105,19 @@ libgosam3-avx512.so: sources/sam3.cpp
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Build fallback variant (all platforms)
|
# Build fallback variant (all platforms)
|
||||||
|
ifeq ($(UNAME_S),Darwin)
|
||||||
|
libgosam3-fallback.dylib: sources/sam3.cpp
|
||||||
|
$(MAKE) purge
|
||||||
|
$(info ${GREEN}I sam3-cpp build info:fallback${RESET})
|
||||||
|
SO_TARGET=libgosam3-fallback.dylib CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgosam3-custom
|
||||||
|
rm -rfv build*
|
||||||
|
else
|
||||||
libgosam3-fallback.so: sources/sam3.cpp
|
libgosam3-fallback.so: sources/sam3.cpp
|
||||||
$(MAKE) purge
|
$(MAKE) purge
|
||||||
$(info ${GREEN}I sam3-cpp build info:fallback${RESET})
|
$(info ${GREEN}I sam3-cpp build info:fallback${RESET})
|
||||||
SO_TARGET=libgosam3-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgosam3-custom
|
SO_TARGET=libgosam3-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgosam3-custom
|
||||||
rm -rfv build*
|
rm -rfv build*
|
||||||
|
endif
|
||||||
|
|
||||||
libgosam3-custom: CMakeLists.txt cpp/gosam3.cpp cpp/gosam3.h
|
libgosam3-custom: CMakeLists.txt cpp/gosam3.cpp cpp/gosam3.h
|
||||||
mkdir -p build-$(SO_TARGET) && \
|
mkdir -p build-$(SO_TARGET) && \
|
||||||
@@ -117,6 +125,7 @@ libgosam3-custom: CMakeLists.txt cpp/gosam3.cpp cpp/gosam3.h
|
|||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) && \
|
cmake --build . --config Release -j$(JOBS) && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/libgosam3.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/libgosam3.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/libgosam3.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
all: sam3-cpp package
|
all: sam3-cpp package
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -21,7 +22,11 @@ func main() {
|
|||||||
// Get library name from environment variable, default to fallback
|
// Get library name from environment variable, default to fallback
|
||||||
libName := os.Getenv("SAM3_LIBRARY")
|
libName := os.Getenv("SAM3_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./libgosam3-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./libgosam3-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./libgosam3-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gosamLib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
gosamLib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
# Create lib directory
|
# Create lib directory
|
||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/libgosam3-*.so $CURDIR/package/
|
cp -fv $CURDIR/libgosam3-*.so $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -fv $CURDIR/libgosam3-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -avf $CURDIR/sam3-cpp $CURDIR/package/
|
cp -avf $CURDIR/sam3-cpp $CURDIR/package/
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/libgosam3-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single dylib variant (Metal or Accelerate)
|
||||||
|
LIBRARY="$CURDIR/libgosam3-fallback.dylib"
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/libgosam3-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/libgosam3-avx.so ]; then
|
if [ -e $CURDIR/libgosam3-avx.so ]; then
|
||||||
@@ -36,9 +40,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/libgosam3-avx512.so"
|
LIBRARY="$CURDIR/libgosam3-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export SAM3_LIBRARY=$LIBRARY
|
export SAM3_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# If there is a lib/ld.so, use it
|
# If there is a lib/ld.so, use it
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -238,11 +239,19 @@ func loadSherpaLibs() error {
|
|||||||
func loadSherpaLibsOnce() error {
|
func loadSherpaLibsOnce() error {
|
||||||
shimLib := os.Getenv("SHERPA_SHIM_LIBRARY")
|
shimLib := os.Getenv("SHERPA_SHIM_LIBRARY")
|
||||||
if shimLib == "" {
|
if shimLib == "" {
|
||||||
shimLib = "libsherpa-shim.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
shimLib = "libsherpa-shim.dylib"
|
||||||
|
} else {
|
||||||
|
shimLib = "libsherpa-shim.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
capiLib := os.Getenv("SHERPA_ONNX_LIBRARY")
|
capiLib := os.Getenv("SHERPA_ONNX_LIBRARY")
|
||||||
if capiLib == "" {
|
if capiLib == "" {
|
||||||
capiLib = "libsherpa-onnx-c-api.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
capiLib = "libsherpa-onnx-c-api.dylib"
|
||||||
|
} else {
|
||||||
|
capiLib = "libsherpa-onnx-c-api.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shim, err := purego.Dlopen(shimLib, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
shim, err := purego.Dlopen(shimLib, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -3,7 +3,13 @@ set -ex
|
|||||||
|
|
||||||
CURDIR=$(dirname "$(realpath $0)")
|
CURDIR=$(dirname "$(realpath $0)")
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
export SHERPA_SHIM_LIBRARY=$CURDIR/lib/libsherpa-shim.dylib
|
||||||
|
export SHERPA_ONNX_LIBRARY=$CURDIR/lib/libsherpa-onnx-c-api.dylib
|
||||||
|
else
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f $CURDIR/lib/ld.so ]; then
|
if [ -f $CURDIR/lib/ld.so ]; then
|
||||||
echo "Using lib/ld.so"
|
echo "Using lib/ld.so"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ JOBS?=$(shell nproc --ignore=1)
|
|||||||
|
|
||||||
# stablediffusion.cpp (ggml)
|
# stablediffusion.cpp (ggml)
|
||||||
STABLEDIFFUSION_GGML_REPO?=https://github.com/leejet/stable-diffusion.cpp
|
STABLEDIFFUSION_GGML_REPO?=https://github.com/leejet/stable-diffusion.cpp
|
||||||
STABLEDIFFUSION_GGML_VERSION?=b12098f5d09fc83da36e65c784f7bdb16a5a5ebf
|
STABLEDIFFUSION_GGML_VERSION?=f440ad9c29dd8bc34e5d1f4b863832b96d6ea05f
|
||||||
|
|
||||||
CMAKE_ARGS+=-DGGML_MAX_NAME=128
|
CMAKE_ARGS+=-DGGML_MAX_NAME=128
|
||||||
|
|
||||||
@@ -131,6 +131,7 @@ libgosd-custom: CMakeLists.txt cpp/gosd.cpp cpp/gosd.h
|
|||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) && \
|
cmake --build . --config Release -j$(JOBS) && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/libgosd.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/libgosd.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/libgosd.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
all: stablediffusion-ggml package
|
all: stablediffusion-ggml package
|
||||||
@@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -21,7 +22,11 @@ func main() {
|
|||||||
// Get library name from environment variable, default to fallback
|
// Get library name from environment variable, default to fallback
|
||||||
libName := os.Getenv("SD_LIBRARY")
|
libName := os.Getenv("SD_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./libgosd-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./libgosd-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./libgosd-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gosd, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
gosd, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/libgosd-*.so $CURDIR/package/
|
cp -avf $CURDIR/libgosd-*.so $CURDIR/package/
|
||||||
|
cp -fv $CURDIR/libgosd-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -avf $CURDIR/stablediffusion-ggml $CURDIR/package/
|
cp -avf $CURDIR/stablediffusion-ggml $CURDIR/package/
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,18 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/libgosd-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single library variant (Metal or Accelerate). The gosd target is
|
||||||
|
# built as a CMake MODULE, which emits a .dylib for a SHARED build but a
|
||||||
|
# .so for a MODULE build on Apple, so prefer .dylib and fall back to .so.
|
||||||
|
LIBRARY="$CURDIR/libgosd-fallback.dylib"
|
||||||
|
if [ ! -e "$LIBRARY" ]; then
|
||||||
|
LIBRARY="$CURDIR/libgosd-fallback.so"
|
||||||
|
fi
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/libgosd-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/libgosd-avx.so ]; then
|
if [ -e $CURDIR/libgosd-avx.so ]; then
|
||||||
@@ -36,9 +45,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/libgosd-avx512.so"
|
LIBRARY="$CURDIR/libgosd-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export SD_LIBRARY=$LIBRARY
|
export SD_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# If there is a lib/ld.so, use it
|
# If there is a lib/ld.so, use it
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ UNAME_S := $(shell uname -s)
|
|||||||
ifeq ($(UNAME_S),Linux)
|
ifeq ($(UNAME_S),Linux)
|
||||||
VARIANT_TARGETS = libgovibevoicecpp-avx.so libgovibevoicecpp-avx2.so libgovibevoicecpp-avx512.so libgovibevoicecpp-fallback.so
|
VARIANT_TARGETS = libgovibevoicecpp-avx.so libgovibevoicecpp-avx2.so libgovibevoicecpp-avx512.so libgovibevoicecpp-fallback.so
|
||||||
else
|
else
|
||||||
# On non-Linux (e.g., Darwin), build only fallback variant
|
# On non-Linux (e.g., Darwin), build only fallback variant (as a dylib)
|
||||||
VARIANT_TARGETS = libgovibevoicecpp-fallback.so
|
VARIANT_TARGETS = libgovibevoicecpp-fallback.dylib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
vibevoice-cpp: main.go govibevoicecpp.go $(VARIANT_TARGETS)
|
vibevoice-cpp: main.go govibevoicecpp.go $(VARIANT_TARGETS)
|
||||||
@@ -83,7 +83,7 @@ package: vibevoice-cpp
|
|||||||
build: package
|
build: package
|
||||||
|
|
||||||
clean: purge
|
clean: purge
|
||||||
rm -rf libgovibevoicecpp*.so package sources/vibevoice.cpp vibevoice-cpp
|
rm -rf libgovibevoicecpp*.so libgovibevoicecpp*.dylib package sources/vibevoice.cpp vibevoice-cpp
|
||||||
|
|
||||||
purge:
|
purge:
|
||||||
rm -rf build*
|
rm -rf build*
|
||||||
@@ -119,13 +119,21 @@ libgovibevoicecpp-fallback.so: sources/vibevoice.cpp
|
|||||||
SO_TARGET=libgovibevoicecpp-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgovibevoicecpp-custom
|
SO_TARGET=libgovibevoicecpp-fallback.so CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgovibevoicecpp-custom
|
||||||
rm -rfv build*
|
rm -rfv build*
|
||||||
|
|
||||||
|
# Build fallback variant as a dylib (Darwin)
|
||||||
|
libgovibevoicecpp-fallback.dylib: sources/vibevoice.cpp
|
||||||
|
$(MAKE) purge
|
||||||
|
$(info ${GREEN}I vibevoice-cpp build info:fallback (dylib)${RESET})
|
||||||
|
SO_TARGET=libgovibevoicecpp-fallback.dylib CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off -DGGML_BMI2=off" $(MAKE) libgovibevoicecpp-custom
|
||||||
|
rm -rfv build*
|
||||||
|
|
||||||
libgovibevoicecpp-custom: CMakeLists.txt cpp/govibevoicecpp.cpp cpp/govibevoicecpp.h
|
libgovibevoicecpp-custom: CMakeLists.txt cpp/govibevoicecpp.cpp cpp/govibevoicecpp.h
|
||||||
mkdir -p build-$(SO_TARGET) && \
|
mkdir -p build-$(SO_TARGET) && \
|
||||||
cd build-$(SO_TARGET) && \
|
cd build-$(SO_TARGET) && \
|
||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) --target govibevoicecpp && \
|
cmake --build . --config Release -j$(JOBS) --target govibevoicecpp && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/libgovibevoicecpp.so ./$(SO_TARGET)
|
(mv build-$(SO_TARGET)/libgovibevoicecpp.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/libgovibevoicecpp.dylib ./$(SO_TARGET) 2>/dev/null)
|
||||||
|
|
||||||
test: vibevoice-cpp
|
test: vibevoice-cpp
|
||||||
@echo "Running vibevoice-cpp tests..."
|
@echo "Running vibevoice-cpp tests..."
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -21,7 +22,11 @@ type LibFuncs struct {
|
|||||||
func main() {
|
func main() {
|
||||||
libName := os.Getenv("VIBEVOICECPP_LIBRARY")
|
libName := os.Getenv("VIBEVOICECPP_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./libgovibevoicecpp-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./libgovibevoicecpp-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./libgovibevoicecpp-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
lib, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/vibevoice-cpp $CURDIR/package/
|
cp -avf $CURDIR/vibevoice-cpp $CURDIR/package/
|
||||||
cp -fv $CURDIR/libgovibevoicecpp-*.so $CURDIR/package/
|
cp -fv $CURDIR/libgovibevoicecpp-*.so $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -fv $CURDIR/libgovibevoicecpp-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
# Detect architecture and copy appropriate libraries
|
# Detect architecture and copy appropriate libraries
|
||||||
|
|||||||
@@ -11,9 +11,13 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/libgovibevoicecpp-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single dylib variant (Metal or Accelerate)
|
||||||
|
LIBRARY="$CURDIR/libgovibevoicecpp-fallback.dylib"
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/libgovibevoicecpp-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/libgovibevoicecpp-avx.so ]; then
|
if [ -e $CURDIR/libgovibevoicecpp-avx.so ]; then
|
||||||
@@ -34,9 +38,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/libgovibevoicecpp-avx512.so"
|
LIBRARY="$CURDIR/libgovibevoicecpp-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export VIBEVOICECPP_LIBRARY=$LIBRARY
|
export VIBEVOICECPP_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
if [ -f $CURDIR/lib/ld.so ]; then
|
if [ -f $CURDIR/lib/ld.so ]; then
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ JOBS?=$(shell nproc --ignore=1)
|
|||||||
|
|
||||||
# whisper.cpp version
|
# whisper.cpp version
|
||||||
WHISPER_REPO?=https://github.com/ggml-org/whisper.cpp
|
WHISPER_REPO?=https://github.com/ggml-org/whisper.cpp
|
||||||
WHISPER_CPP_VERSION?=5ed76e9a079962f1c85cfce44edd325c27ef1f97
|
WHISPER_CPP_VERSION?=43d78af5be58f41d6ffbc227d608f104577741ea
|
||||||
SO_TARGET?=libgowhisper.so
|
SO_TARGET?=libgowhisper.so
|
||||||
|
|
||||||
CMAKE_ARGS+=-DBUILD_SHARED_LIBS=OFF
|
CMAKE_ARGS+=-DBUILD_SHARED_LIBS=OFF
|
||||||
@@ -117,6 +117,7 @@ libgowhisper-custom: CMakeLists.txt cpp/gowhisper.cpp cpp/gowhisper.h
|
|||||||
cmake .. $(CMAKE_ARGS) && \
|
cmake .. $(CMAKE_ARGS) && \
|
||||||
cmake --build . --config Release -j$(JOBS) && \
|
cmake --build . --config Release -j$(JOBS) && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
mv build-$(SO_TARGET)/libgowhisper.so ./$(SO_TARGET)
|
mv build-$(SO_TARGET)/libgowhisper.so ./$(SO_TARGET) 2>/dev/null || \
|
||||||
|
mv build-$(SO_TARGET)/libgowhisper.dylib ./$(SO_TARGET:.so=.dylib)
|
||||||
|
|
||||||
all: whisper package
|
all: whisper package
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/ebitengine/purego"
|
"github.com/ebitengine/purego"
|
||||||
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
grpc "github.com/mudler/LocalAI/pkg/grpc"
|
||||||
@@ -22,7 +23,11 @@ func main() {
|
|||||||
// Get library name from environment variable, default to fallback
|
// Get library name from environment variable, default to fallback
|
||||||
libName := os.Getenv("WHISPER_LIBRARY")
|
libName := os.Getenv("WHISPER_LIBRARY")
|
||||||
if libName == "" {
|
if libName == "" {
|
||||||
libName = "./libgowhisper-fallback.so"
|
if runtime.GOOS == "darwin" {
|
||||||
|
libName = "./libgowhisper-fallback.dylib"
|
||||||
|
} else {
|
||||||
|
libName = "./libgowhisper-fallback.so"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gosd, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
gosd, err := purego.Dlopen(libName, purego.RTLD_NOW|purego.RTLD_GLOBAL)
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ REPO_ROOT="${CURDIR}/../../.."
|
|||||||
mkdir -p $CURDIR/package/lib
|
mkdir -p $CURDIR/package/lib
|
||||||
|
|
||||||
cp -avf $CURDIR/whisper $CURDIR/package/
|
cp -avf $CURDIR/whisper $CURDIR/package/
|
||||||
cp -fv $CURDIR/libgowhisper-*.so $CURDIR/package/
|
cp -fv $CURDIR/libgowhisper-*.so $CURDIR/package/ 2>/dev/null || true
|
||||||
|
cp -fv $CURDIR/libgowhisper-*.dylib $CURDIR/package/ 2>/dev/null || true
|
||||||
cp -fv $CURDIR/run.sh $CURDIR/package/
|
cp -fv $CURDIR/run.sh $CURDIR/package/
|
||||||
|
|
||||||
# Detect architecture and copy appropriate libraries
|
# Detect architecture and copy appropriate libraries
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
grep -e "flags" /proc/cpuinfo | head -1
|
grep -e "flags" /proc/cpuinfo | head -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBRARY="$CURDIR/libgowhisper-fallback.so"
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
|
# macOS: single dylib variant (Metal or Accelerate)
|
||||||
|
LIBRARY="$CURDIR/libgowhisper-fallback.dylib"
|
||||||
|
export DYLD_LIBRARY_PATH=$CURDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
|
else
|
||||||
|
LIBRARY="$CURDIR/libgowhisper-fallback.so"
|
||||||
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
||||||
echo "CPU: AVX found OK"
|
echo "CPU: AVX found OK"
|
||||||
if [ -e $CURDIR/libgowhisper-avx.so ]; then
|
if [ -e $CURDIR/libgowhisper-avx.so ]; then
|
||||||
@@ -36,9 +40,10 @@ if [ "$(uname)" != "Darwin" ]; then
|
|||||||
LIBRARY="$CURDIR/libgowhisper-avx512.so"
|
LIBRARY="$CURDIR/libgowhisper-avx512.so"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$CURDIR/lib:$LD_LIBRARY_PATH
|
|
||||||
export WHISPER_LIBRARY=$LIBRARY
|
export WHISPER_LIBRARY=$LIBRARY
|
||||||
|
|
||||||
# If there is a lib/ld.so, use it
|
# If there is a lib/ld.so, use it
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--extra-index-url https://download.pytorch.org/whl/cpu
|
--extra-index-url https://download.pytorch.org/whl/cpu
|
||||||
git+https://github.com/huggingface/diffusers
|
diffusers==0.38.0
|
||||||
opencv-python
|
opencv-python
|
||||||
transformers
|
transformers==4.57.6
|
||||||
torchvision==0.22.1
|
torchvision==0.22.1
|
||||||
accelerate
|
accelerate
|
||||||
git+https://github.com/xhinker/sd_embed
|
git+https://github.com/xhinker/sd_embed
|
||||||
@@ -10,9 +10,15 @@ sentencepiece
|
|||||||
torch==2.7.1
|
torch==2.7.1
|
||||||
optimum-quanto
|
optimum-quanto
|
||||||
ftfy
|
ftfy
|
||||||
# TODO: re-add compel once it supports transformers >= 5.
|
# diffusers and transformers are pinned together on purpose. transformers v5
|
||||||
# Tracking: https://github.com/damian0815/compel/pull/129
|
# restructured CLIPTextModel and dropped the `.text_model` attribute, which
|
||||||
# https://github.com/damian0815/compel/issues/128
|
# breaks single-file Stable Diffusion loading on every released diffusers
|
||||||
# compel currently pins transformers~=4.25, which forced pip into multi-hour
|
# (<=0.38.0); only unreleased diffusers main supports transformers v5. Tracking
|
||||||
# resolver backtracking storms in CI. backend.py imports it lazily and gates
|
# main via git froze whichever broken pair existed at image-build time. Pin the
|
||||||
# the COMPEL=1 env var on the import succeeding, so dropping it here is safe.
|
# last known-good released pair so builds are reproducible and can't drift into
|
||||||
|
# the broken window. See https://github.com/mudler/LocalAI/issues/9979
|
||||||
|
#
|
||||||
|
# compel is intentionally omitted: it pins transformers~=4.25, which conflicts
|
||||||
|
# with this pin and previously forced pip into multi-hour resolver backtracking
|
||||||
|
# storms in CI. backend.py imports it lazily and gates the COMPEL=1 env var on
|
||||||
|
# the import succeeding, so dropping it here is safe.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
--extra-index-url https://download.pytorch.org/whl/cu121
|
--extra-index-url https://download.pytorch.org/whl/cu121
|
||||||
git+https://github.com/huggingface/diffusers
|
diffusers==0.38.0
|
||||||
opencv-python
|
opencv-python
|
||||||
transformers
|
transformers==4.57.6
|
||||||
torchvision
|
torchvision
|
||||||
accelerate
|
accelerate
|
||||||
git+https://github.com/xhinker/sd_embed
|
git+https://github.com/xhinker/sd_embed
|
||||||
@@ -10,9 +10,15 @@ sentencepiece
|
|||||||
torch
|
torch
|
||||||
ftfy
|
ftfy
|
||||||
optimum-quanto
|
optimum-quanto
|
||||||
# TODO: re-add compel once it supports transformers >= 5.
|
# diffusers and transformers are pinned together on purpose. transformers v5
|
||||||
# Tracking: https://github.com/damian0815/compel/pull/129
|
# restructured CLIPTextModel and dropped the `.text_model` attribute, which
|
||||||
# https://github.com/damian0815/compel/issues/128
|
# breaks single-file Stable Diffusion loading on every released diffusers
|
||||||
# compel currently pins transformers~=4.25, which forced pip into multi-hour
|
# (<=0.38.0); only unreleased diffusers main supports transformers v5. Tracking
|
||||||
# resolver backtracking storms in CI. backend.py imports it lazily and gates
|
# main via git froze whichever broken pair existed at image-build time. Pin the
|
||||||
# the COMPEL=1 env var on the import succeeding, so dropping it here is safe.
|
# last known-good released pair so builds are reproducible and can't drift into
|
||||||
|
# the broken window. See https://github.com/mudler/LocalAI/issues/9979
|
||||||
|
#
|
||||||
|
# compel is intentionally omitted: it pins transformers~=4.25, which conflicts
|
||||||
|
# with this pin and previously forced pip into multi-hour resolver backtracking
|
||||||
|
# storms in CI. backend.py imports it lazily and gates the COMPEL=1 env var on
|
||||||
|
# the import succeeding, so dropping it here is safe.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--extra-index-url https://download.pytorch.org/whl/cu130
|
--extra-index-url https://download.pytorch.org/whl/cu130
|
||||||
git+https://github.com/huggingface/diffusers
|
diffusers==0.38.0
|
||||||
opencv-python
|
opencv-python
|
||||||
transformers
|
transformers==4.57.6
|
||||||
torchvision
|
torchvision
|
||||||
accelerate
|
accelerate
|
||||||
git+https://github.com/xhinker/sd_embed
|
git+https://github.com/xhinker/sd_embed
|
||||||
@@ -10,9 +10,15 @@ sentencepiece
|
|||||||
torch
|
torch
|
||||||
ftfy
|
ftfy
|
||||||
optimum-quanto
|
optimum-quanto
|
||||||
# TODO: re-add compel once it supports transformers >= 5.
|
# diffusers and transformers are pinned together on purpose. transformers v5
|
||||||
# Tracking: https://github.com/damian0815/compel/pull/129
|
# restructured CLIPTextModel and dropped the `.text_model` attribute, which
|
||||||
# https://github.com/damian0815/compel/issues/128
|
# breaks single-file Stable Diffusion loading on every released diffusers
|
||||||
# compel currently pins transformers~=4.25, which forced pip into multi-hour
|
# (<=0.38.0); only unreleased diffusers main supports transformers v5. Tracking
|
||||||
# resolver backtracking storms in CI. backend.py imports it lazily and gates
|
# main via git froze whichever broken pair existed at image-build time. Pin the
|
||||||
# the COMPEL=1 env var on the import succeeding, so dropping it here is safe.
|
# last known-good released pair so builds are reproducible and can't drift into
|
||||||
|
# the broken window. See https://github.com/mudler/LocalAI/issues/9979
|
||||||
|
#
|
||||||
|
# compel is intentionally omitted: it pins transformers~=4.25, which conflicts
|
||||||
|
# with this pin and previously forced pip into multi-hour resolver backtracking
|
||||||
|
# storms in CI. backend.py imports it lazily and gates the COMPEL=1 env var on
|
||||||
|
# the import succeeding, so dropping it here is safe.
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
--extra-index-url https://download.pytorch.org/whl/rocm7.0
|
--extra-index-url https://download.pytorch.org/whl/rocm7.0
|
||||||
torch==2.10.0+rocm7.0
|
torch==2.10.0+rocm7.0
|
||||||
torchvision==0.25.0+rocm7.0
|
torchvision==0.25.0+rocm7.0
|
||||||
git+https://github.com/huggingface/diffusers
|
diffusers==0.38.0
|
||||||
opencv-python
|
opencv-python
|
||||||
transformers
|
transformers==4.57.6
|
||||||
accelerate
|
accelerate
|
||||||
peft
|
peft
|
||||||
sentencepiece
|
sentencepiece
|
||||||
optimum-quanto
|
optimum-quanto
|
||||||
ftfy
|
ftfy
|
||||||
# TODO: re-add compel once it supports transformers >= 5.
|
# diffusers and transformers are pinned together on purpose. transformers v5
|
||||||
# Tracking: https://github.com/damian0815/compel/pull/129
|
# restructured CLIPTextModel and dropped the `.text_model` attribute, which
|
||||||
# https://github.com/damian0815/compel/issues/128
|
# breaks single-file Stable Diffusion loading on every released diffusers
|
||||||
# compel currently pins transformers~=4.25, which forced pip into multi-hour
|
# (<=0.38.0); only unreleased diffusers main supports transformers v5. Tracking
|
||||||
# resolver backtracking storms in CI. backend.py imports it lazily and gates
|
# main via git froze whichever broken pair existed at image-build time. Pin the
|
||||||
# the COMPEL=1 env var on the import succeeding, so dropping it here is safe.
|
# last known-good released pair so builds are reproducible and can't drift into
|
||||||
|
# the broken window. See https://github.com/mudler/LocalAI/issues/9979
|
||||||
|
#
|
||||||
|
# compel is intentionally omitted: it pins transformers~=4.25, which conflicts
|
||||||
|
# with this pin and previously forced pip into multi-hour resolver backtracking
|
||||||
|
# storms in CI. backend.py imports it lazily and gates the COMPEL=1 env var on
|
||||||
|
# the import succeeding, so dropping it here is safe.
|
||||||
@@ -3,18 +3,24 @@ torch
|
|||||||
torchvision
|
torchvision
|
||||||
optimum[openvino]
|
optimum[openvino]
|
||||||
setuptools
|
setuptools
|
||||||
git+https://github.com/huggingface/diffusers
|
diffusers==0.38.0
|
||||||
opencv-python
|
opencv-python
|
||||||
transformers
|
transformers==4.57.6
|
||||||
accelerate
|
accelerate
|
||||||
git+https://github.com/xhinker/sd_embed
|
git+https://github.com/xhinker/sd_embed
|
||||||
peft
|
peft
|
||||||
sentencepiece
|
sentencepiece
|
||||||
optimum-quanto
|
optimum-quanto
|
||||||
ftfy
|
ftfy
|
||||||
# TODO: re-add compel once it supports transformers >= 5.
|
# diffusers and transformers are pinned together on purpose. transformers v5
|
||||||
# Tracking: https://github.com/damian0815/compel/pull/129
|
# restructured CLIPTextModel and dropped the `.text_model` attribute, which
|
||||||
# https://github.com/damian0815/compel/issues/128
|
# breaks single-file Stable Diffusion loading on every released diffusers
|
||||||
# compel currently pins transformers~=4.25, which forced pip into multi-hour
|
# (<=0.38.0); only unreleased diffusers main supports transformers v5. Tracking
|
||||||
# resolver backtracking storms in CI. backend.py imports it lazily and gates
|
# main via git froze whichever broken pair existed at image-build time. Pin the
|
||||||
# the COMPEL=1 env var on the import succeeding, so dropping it here is safe.
|
# last known-good released pair so builds are reproducible and can't drift into
|
||||||
|
# the broken window. See https://github.com/mudler/LocalAI/issues/9979
|
||||||
|
#
|
||||||
|
# compel is intentionally omitted: it pins transformers~=4.25, which conflicts
|
||||||
|
# with this pin and previously forced pip into multi-hour resolver backtracking
|
||||||
|
# storms in CI. backend.py imports it lazily and gates the COMPEL=1 env var on
|
||||||
|
# the import succeeding, so dropping it here is safe.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
--extra-index-url https://pypi.jetson-ai-lab.io/jp6/cu129/
|
--extra-index-url https://pypi.jetson-ai-lab.io/jp6/cu129/
|
||||||
torch
|
torch
|
||||||
git+https://github.com/huggingface/diffusers
|
diffusers==0.38.0
|
||||||
transformers
|
transformers==4.57.6
|
||||||
accelerate
|
accelerate
|
||||||
peft
|
peft
|
||||||
optimum-quanto
|
optimum-quanto
|
||||||
@@ -9,9 +9,15 @@ numpy<2
|
|||||||
sentencepiece
|
sentencepiece
|
||||||
torchvision
|
torchvision
|
||||||
ftfy
|
ftfy
|
||||||
# TODO: re-add compel once it supports transformers >= 5.
|
# diffusers and transformers are pinned together on purpose. transformers v5
|
||||||
# Tracking: https://github.com/damian0815/compel/pull/129
|
# restructured CLIPTextModel and dropped the `.text_model` attribute, which
|
||||||
# https://github.com/damian0815/compel/issues/128
|
# breaks single-file Stable Diffusion loading on every released diffusers
|
||||||
# compel currently pins transformers~=4.25, which forced pip into multi-hour
|
# (<=0.38.0); only unreleased diffusers main supports transformers v5. Tracking
|
||||||
# resolver backtracking storms in CI. backend.py imports it lazily and gates
|
# main via git froze whichever broken pair existed at image-build time. Pin the
|
||||||
# the COMPEL=1 env var on the import succeeding, so dropping it here is safe.
|
# last known-good released pair so builds are reproducible and can't drift into
|
||||||
|
# the broken window. See https://github.com/mudler/LocalAI/issues/9979
|
||||||
|
#
|
||||||
|
# compel is intentionally omitted: it pins transformers~=4.25, which conflicts
|
||||||
|
# with this pin and previously forced pip into multi-hour resolver backtracking
|
||||||
|
# storms in CI. backend.py imports it lazily and gates the COMPEL=1 env var on
|
||||||
|
# the import succeeding, so dropping it here is safe.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--extra-index-url https://download.pytorch.org/whl/cu130
|
--extra-index-url https://download.pytorch.org/whl/cu130
|
||||||
torch
|
torch
|
||||||
git+https://github.com/huggingface/diffusers
|
diffusers==0.38.0
|
||||||
transformers
|
transformers==4.57.6
|
||||||
accelerate
|
accelerate
|
||||||
peft
|
peft
|
||||||
optimum-quanto
|
optimum-quanto
|
||||||
@@ -10,9 +10,15 @@ sentencepiece
|
|||||||
torchvision
|
torchvision
|
||||||
ftfy
|
ftfy
|
||||||
chardet
|
chardet
|
||||||
# TODO: re-add compel once it supports transformers >= 5.
|
# diffusers and transformers are pinned together on purpose. transformers v5
|
||||||
# Tracking: https://github.com/damian0815/compel/pull/129
|
# restructured CLIPTextModel and dropped the `.text_model` attribute, which
|
||||||
# https://github.com/damian0815/compel/issues/128
|
# breaks single-file Stable Diffusion loading on every released diffusers
|
||||||
# compel currently pins transformers~=4.25, which forced pip into multi-hour
|
# (<=0.38.0); only unreleased diffusers main supports transformers v5. Tracking
|
||||||
# resolver backtracking storms in CI. backend.py imports it lazily and gates
|
# main via git froze whichever broken pair existed at image-build time. Pin the
|
||||||
# the COMPEL=1 env var on the import succeeding, so dropping it here is safe.
|
# last known-good released pair so builds are reproducible and can't drift into
|
||||||
|
# the broken window. See https://github.com/mudler/LocalAI/issues/9979
|
||||||
|
#
|
||||||
|
# compel is intentionally omitted: it pins transformers~=4.25, which conflicts
|
||||||
|
# with this pin and previously forced pip into multi-hour resolver backtracking
|
||||||
|
# storms in CI. backend.py imports it lazily and gates the COMPEL=1 env var on
|
||||||
|
# the import succeeding, so dropping it here is safe.
|
||||||
|
|||||||
@@ -1,16 +1,22 @@
|
|||||||
torch==2.7.1
|
torch==2.7.1
|
||||||
torchvision==0.22.1
|
torchvision==0.22.1
|
||||||
git+https://github.com/huggingface/diffusers
|
diffusers==0.38.0
|
||||||
opencv-python
|
opencv-python
|
||||||
transformers
|
transformers==4.57.6
|
||||||
accelerate
|
accelerate
|
||||||
peft
|
peft
|
||||||
sentencepiece
|
sentencepiece
|
||||||
optimum-quanto
|
optimum-quanto
|
||||||
ftfy
|
ftfy
|
||||||
# TODO: re-add compel once it supports transformers >= 5.
|
# diffusers and transformers are pinned together on purpose. transformers v5
|
||||||
# Tracking: https://github.com/damian0815/compel/pull/129
|
# restructured CLIPTextModel and dropped the `.text_model` attribute, which
|
||||||
# https://github.com/damian0815/compel/issues/128
|
# breaks single-file Stable Diffusion loading on every released diffusers
|
||||||
# compel currently pins transformers~=4.25, which forced pip into multi-hour
|
# (<=0.38.0); only unreleased diffusers main supports transformers v5. Tracking
|
||||||
# resolver backtracking storms in CI. backend.py imports it lazily and gates
|
# main via git froze whichever broken pair existed at image-build time. Pin the
|
||||||
# the COMPEL=1 env var on the import succeeding, so dropping it here is safe.
|
# last known-good released pair so builds are reproducible and can't drift into
|
||||||
|
# the broken window. See https://github.com/mudler/LocalAI/issues/9979
|
||||||
|
#
|
||||||
|
# compel is intentionally omitted: it pins transformers~=4.25, which conflicts
|
||||||
|
# with this pin and previously forced pip into multi-hour resolver backtracking
|
||||||
|
# storms in CI. backend.py imports it lazily and gates the COMPEL=1 env var on
|
||||||
|
# the import succeeding, so dropping it here is safe.
|
||||||
@@ -341,11 +341,9 @@ func (a *Application) ResolvePIIPolicy(cfg *config.ModelConfig) (enabled bool, d
|
|||||||
}
|
}
|
||||||
appCfg := a.ApplicationConfig()
|
appCfg := a.ApplicationConfig()
|
||||||
|
|
||||||
if cfg.PII.Enabled != nil {
|
// PIIIsEnabled already encodes "explicit pii.enabled wins, else backend
|
||||||
enabled = *cfg.PII.Enabled
|
// default (cloud-proxy)" — the single source of that rule.
|
||||||
} else {
|
enabled = cfg.PIIIsEnabled()
|
||||||
enabled = cfg.PIIIsEnabled() // backend default (cloud-proxy)
|
|
||||||
}
|
|
||||||
if !enabled {
|
if !enabled {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
@@ -354,7 +352,7 @@ func (a *Application) ResolvePIIPolicy(cfg *config.ModelConfig) (enabled bool, d
|
|||||||
if len(detectors) == 0 {
|
if len(detectors) == 0 {
|
||||||
detectors = append([]string(nil), appCfg.PIIDefaultDetectors...)
|
detectors = append([]string(nil), appCfg.PIIDefaultDetectors...)
|
||||||
}
|
}
|
||||||
return enabled, detectors
|
return true, detectors // enabled is necessarily true past the !enabled guard
|
||||||
}
|
}
|
||||||
|
|
||||||
// PIIPolicyResolver adapts ResolvePIIPolicy to pii.PolicyResolver for
|
// PIIPolicyResolver adapts ResolvePIIPolicy to pii.PolicyResolver for
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ func readRuntimeSettingsJson(startupAppConfig config.ApplicationConfig) fileHand
|
|||||||
envBackendGalleries := slices.Equal(appConfig.BackendGalleries, startupAppConfig.BackendGalleries)
|
envBackendGalleries := slices.Equal(appConfig.BackendGalleries, startupAppConfig.BackendGalleries)
|
||||||
envAutoloadGalleries := appConfig.AutoloadGalleries == startupAppConfig.AutoloadGalleries
|
envAutoloadGalleries := appConfig.AutoloadGalleries == startupAppConfig.AutoloadGalleries
|
||||||
envAutoloadBackendGalleries := appConfig.AutoloadBackendGalleries == startupAppConfig.AutoloadBackendGalleries
|
envAutoloadBackendGalleries := appConfig.AutoloadBackendGalleries == startupAppConfig.AutoloadBackendGalleries
|
||||||
|
envPIIDefaultDetectors := slices.Equal(appConfig.PIIDefaultDetectors, startupAppConfig.PIIDefaultDetectors)
|
||||||
envAgentJobRetentionDays := appConfig.AgentJobRetentionDays == startupAppConfig.AgentJobRetentionDays
|
envAgentJobRetentionDays := appConfig.AgentJobRetentionDays == startupAppConfig.AgentJobRetentionDays
|
||||||
envForceEvictionWhenBusy := appConfig.ForceEvictionWhenBusy == startupAppConfig.ForceEvictionWhenBusy
|
envForceEvictionWhenBusy := appConfig.ForceEvictionWhenBusy == startupAppConfig.ForceEvictionWhenBusy
|
||||||
envLRUEvictionMaxRetries := appConfig.LRUEvictionMaxRetries == startupAppConfig.LRUEvictionMaxRetries
|
envLRUEvictionMaxRetries := appConfig.LRUEvictionMaxRetries == startupAppConfig.LRUEvictionMaxRetries
|
||||||
@@ -335,6 +336,15 @@ func readRuntimeSettingsJson(startupAppConfig config.ApplicationConfig) fileHand
|
|||||||
if settings.AutoloadBackendGalleries != nil && !envAutoloadBackendGalleries {
|
if settings.AutoloadBackendGalleries != nil && !envAutoloadBackendGalleries {
|
||||||
appConfig.AutoloadBackendGalleries = *settings.AutoloadBackendGalleries
|
appConfig.AutoloadBackendGalleries = *settings.AutoloadBackendGalleries
|
||||||
}
|
}
|
||||||
|
if settings.PIIDefaultDetectors != nil && !envPIIDefaultDetectors {
|
||||||
|
// Request-side default redaction reads this live via
|
||||||
|
// ResolvePIIPolicy, so a file edit takes effect on the next chat
|
||||||
|
// request. The MITM listener resolves its per-host detector map
|
||||||
|
// once at start, so a raw file edit reaches cloud-proxy traffic
|
||||||
|
// only after a restart or a POST /api/settings (which rebuilds
|
||||||
|
// the listener) — the admin UI uses the latter.
|
||||||
|
appConfig.PIIDefaultDetectors = append([]string(nil), (*settings.PIIDefaultDetectors)...)
|
||||||
|
}
|
||||||
if settings.AutoUpgradeBackends != nil {
|
if settings.AutoUpgradeBackends != nil {
|
||||||
appConfig.AutoUpgradeBackends = *settings.AutoUpgradeBackends
|
appConfig.AutoUpgradeBackends = *settings.AutoUpgradeBackends
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,6 +357,15 @@ func initDistributed(cfg *config.ApplicationConfig, authDB *gorm.DB, configLoade
|
|||||||
Pressure: pressure,
|
Pressure: pressure,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Wire staging-progress broadcasting so file-staging shows up on every
|
||||||
|
// replica, not just the one performing the transfer. Without this, a
|
||||||
|
// /api/operations poll that round-robins onto a peer sees no staging row and
|
||||||
|
// the progress flickers. The origin publishes; peers mirror via the wildcard.
|
||||||
|
router.StagingTracker().SetPublisher(natsClient)
|
||||||
|
if _, err := router.StagingTracker().SubscribeBroadcasts(natsClient); err != nil {
|
||||||
|
xlog.Warn("Failed to subscribe to staging progress broadcasts", "error", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Create ReplicaReconciler for auto-scaling model replicas. Adapter +
|
// Create ReplicaReconciler for auto-scaling model replicas. Adapter +
|
||||||
// RegistrationToken feed the state-reconciliation passes: pending op
|
// RegistrationToken feed the state-reconciliation passes: pending op
|
||||||
// drain uses the adapter, and model health probes use the token to auth
|
// drain uses the adapter, and model health probes use the token to auth
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user