mirror of
https://github.com/mudler/LocalAI.git
synced 2025-12-30 22:20:20 -06:00
feat(diffusers): add MPS version (#6121)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
committed by
GitHub
parent
d04bd47116
commit
0fd395d6ec
6
.github/workflows/backend_build_darwin.yml
vendored
6
.github/workflows/backend_build_darwin.yml
vendored
@@ -12,6 +12,10 @@ on:
|
||||
description: 'Build type (e.g., mps)'
|
||||
default: ''
|
||||
type: string
|
||||
use-pip:
|
||||
description: 'Use pip to install dependencies'
|
||||
default: false
|
||||
type: boolean
|
||||
go-version:
|
||||
description: 'Go version to use'
|
||||
default: '1.24.x'
|
||||
@@ -63,7 +67,7 @@ jobs:
|
||||
- name: Build ${{ inputs.backend }}-darwin
|
||||
run: |
|
||||
make protogen-go
|
||||
BACKEND=${{ inputs.backend }} BUILD_TYPE=${{ inputs.build-type }} make build-darwin-python-backend
|
||||
BACKEND=${{ inputs.backend }} BUILD_TYPE=${{ inputs.build-type }} USE_PIP=${{ inputs.use-pip }} make build-darwin-python-backend
|
||||
|
||||
- name: Upload ${{ inputs.backend }}.tar
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
4
Makefile
4
Makefile
@@ -369,6 +369,10 @@ backends/mlx:
|
||||
BACKEND=mlx BUILD_TYPE=mps $(MAKE) build-darwin-python-backend
|
||||
./local-ai backends install "ocifile://$(abspath ./backend-images/mlx.tar)"
|
||||
|
||||
backends/diffuser-darwin:
|
||||
USE_PIP=true BACKEND=diffusers BUILD_TYPE=mps $(MAKE) build-darwin-python-backend
|
||||
./local-ai backends install "ocifile://$(abspath ./backend-images/diffusers.tar)"
|
||||
|
||||
backend-images:
|
||||
mkdir -p backend-images
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@
|
||||
intel: "intel-diffusers"
|
||||
amd: "rocm-diffusers"
|
||||
nvidia-l4t: "nvidia-l4t-diffusers"
|
||||
metal: "metal-diffusers"
|
||||
- &exllama2
|
||||
name: "exllama2"
|
||||
urls:
|
||||
@@ -875,6 +876,7 @@
|
||||
intel: "intel-diffusers-development"
|
||||
amd: "rocm-diffusers-development"
|
||||
nvidia-l4t: "nvidia-l4t-diffusers-development"
|
||||
metal: "metal-diffusers-development"
|
||||
- !!merge <<: *diffusers
|
||||
name: "nvidia-l4t-diffusers"
|
||||
uri: "quay.io/go-skynet/local-ai-backends:latest-gpu-nvidia-l4t-diffusers"
|
||||
@@ -925,6 +927,16 @@
|
||||
uri: "quay.io/go-skynet/local-ai-backends:master-gpu-intel-diffusers"
|
||||
mirrors:
|
||||
- localai/localai-backends:master-gpu-intel-diffusers
|
||||
- !!merge <<: *diffusers
|
||||
name: "metal-diffusers"
|
||||
uri: "quay.io/go-skynet/local-ai-backends:latest-metal-darwin-arm64-diffusers"
|
||||
mirrors:
|
||||
- localai/localai-backends:latest-metal-darwin-arm64-diffusers
|
||||
- !!merge <<: *diffusers
|
||||
name: "metal-diffusers-development"
|
||||
uri: "quay.io/go-skynet/local-ai-backends:master-metal-darwin-arm64-diffusers"
|
||||
mirrors:
|
||||
- localai/localai-backends:master-metal-darwin-arm64-diffusers
|
||||
## exllama2
|
||||
- !!merge <<: *exllama2
|
||||
name: "exllama2-development"
|
||||
|
||||
10
backend/python/diffusers/requirements-mps.txt
Normal file
10
backend/python/diffusers/requirements-mps.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
torch==2.7.1
|
||||
torchvision==0.22.1
|
||||
git+https://github.com/huggingface/diffusers
|
||||
opencv-python
|
||||
transformers
|
||||
accelerate
|
||||
compel
|
||||
peft
|
||||
sentencepiece
|
||||
optimum-quanto
|
||||
@@ -12,4 +12,6 @@ if [ -d "/opt/intel" ]; then
|
||||
export XPU=1
|
||||
fi
|
||||
|
||||
export PYTORCH_ENABLE_MPS_FALLBACK=1
|
||||
|
||||
startBackend $@
|
||||
|
||||
Reference in New Issue
Block a user