Skip to content

Commit

Permalink
dependencies(grpcio): bump to fix CI issues (#2362)
Browse files Browse the repository at this point in the history
feat(grpcio): bump to fix CI issues

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
  • Loading branch information
mudler committed May 21, 2024
1 parent a58ff00 commit 1a3dede
Show file tree
Hide file tree
Showing 28 changed files with 159 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate_grpc_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
build-args: |
GRPC_BASE_IMAGE=${{ matrix.grpc-base-image }}
GRPC_MAKEFLAGS=--jobs=4 --output-sync=target
GRPC_VERSION=v1.63.0
GRPC_VERSION=v1.64.0
context: .
file: ./Dockerfile
cache-to: type=gha,ignore-error=true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ jobs:
BASE_IMAGE=${{ inputs.base-image }}
GRPC_BASE_IMAGE=${{ inputs.grpc-base-image || inputs.base-image }}
GRPC_MAKEFLAGS=--jobs=4 --output-sync=target
GRPC_VERSION=v1.63.0
GRPC_VERSION=v1.64.0
MAKEFLAGS=${{ inputs.makeflags }}
context: .
file: ./Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- pull_request

env:
GRPC_VERSION: v1.63.0
GRPC_VERSION: v1.64.0

permissions:
contents: write
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
sudo apt-get install -y libopencv-dev
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test transformers
run: |
Expand All @@ -51,7 +51,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
sudo apt-get install -y libopencv-dev
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test sentencetransformers
run: |
Expand All @@ -74,7 +74,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
sudo apt-get install -y libopencv-dev
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test rerankers
run: |
Expand All @@ -96,7 +96,7 @@ jobs:
sudo apt-get install -y libopencv-dev
# Install UV
curl -LsSf https://astral.sh/uv/install.sh | sh
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test diffusers
run: |
make --jobs=5 --output-sync=target -C backend/python/diffusers
Expand All @@ -117,7 +117,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
sudo apt-get install -y libopencv-dev
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test parler-tts
run: |
Expand All @@ -139,7 +139,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
sudo apt-get install -y libopencv-dev
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test openvoice
run: |
Expand All @@ -161,7 +161,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
sudo apt-get install -y libopencv-dev
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test transformers-musicgen
run: |
Expand All @@ -185,7 +185,7 @@ jobs:
# curl -LsSf https://astral.sh/uv/install.sh | sh
# sudo apt-get install -y ca-certificates cmake curl patch python3-pip
# sudo apt-get install -y libopencv-dev
# pip install --user grpcio-tools==1.63.0
# pip install --user grpcio-tools==1.64.0

# - name: Test petals
# run: |
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
# curl -LsSf https://astral.sh/uv/install.sh | sh
# sudo apt-get install -y ca-certificates cmake curl patch python3-pip
# sudo apt-get install -y libopencv-dev
# pip install --user grpcio-tools==1.63.0
# pip install --user grpcio-tools==1.64.0

# - name: Test bark
# run: |
Expand All @@ -274,7 +274,7 @@ jobs:
# curl -LsSf https://astral.sh/uv/install.sh | sh
# sudo apt-get install -y ca-certificates cmake curl patch python3-pip
# sudo apt-get install -y libopencv-dev
# pip install --user grpcio-tools==1.63.0
# pip install --user grpcio-tools==1.64.0
# - name: Test vllm
# run: |
# make --jobs=5 --output-sync=target -C backend/python/vllm
Expand All @@ -294,7 +294,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
sudo apt-get install -y ca-certificates cmake curl patch python3-pip
sudo apt-get install -y libopencv-dev
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test vall-e-x
run: |
make --jobs=5 --output-sync=target -C backend/python/vall-e-x
Expand All @@ -314,7 +314,7 @@ jobs:
sudo apt-get install -y ca-certificates cmake curl patch espeak espeak-ng python3-pip
# Install UV
curl -LsSf https://astral.sh/uv/install.sh | sh
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test coqui
run: |
make --jobs=5 --output-sync=target -C backend/python/coqui
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- '*'

env:
GRPC_VERSION: v1.63.0
GRPC_VERSION: v1.64.0

concurrency:
group: ci-tests-${{ github.head_ref || github.ref }}-${{ github.repository }}
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
- name: Dependencies
run: |
brew install protobuf grpc make protoc-gen-go protoc-gen-go-grpc
pip install --user grpcio-tools==1.63.0
pip install --user grpcio-tools==1.64.0
- name: Test
run: |
export C_INCLUDE_PATH=/usr/local/include
Expand Down
2 changes: 1 addition & 1 deletion backend/python/autogptq/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accelerate
auto-gptq==0.7.1
grpcio==1.63.0
grpcio==1.64.0
protobuf
torch
certifi
Expand Down
2 changes: 1 addition & 1 deletion backend/python/bark/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accelerate
bark==0.1.5
grpcio==1.63.0
grpcio==1.64.0
protobuf
certifi
transformers
2 changes: 1 addition & 1 deletion backend/python/common/template/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
grpcio==1.63.0
grpcio==1.64.0
protobuf
2 changes: 1 addition & 1 deletion backend/python/coqui/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accelerate
TTS==0.22.0
grpcio==1.63.0
grpcio==1.64.0
protobuf
certifi
transformers
2 changes: 1 addition & 1 deletion backend/python/diffusers/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
accelerate
compel
diffusers
grpcio==1.63.0
grpcio==1.64.0
opencv-python
pillow
protobuf
Expand Down
2 changes: 1 addition & 1 deletion backend/python/exllama/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
grpcio==1.63.0
grpcio==1.64.0
protobuf
torch
transformers
Expand Down
2 changes: 1 addition & 1 deletion backend/python/exllama2/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
accelerate
grpcio==1.63.0
grpcio==1.64.0
protobuf
certifi
torch
Expand Down
2 changes: 1 addition & 1 deletion backend/python/mamba/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
causal-conv1d==1.2.0.post2
mamba-ssm==1.2.0.post1
grpcio==1.63.0
grpcio==1.64.0
protobuf
certifi
transformers
2 changes: 1 addition & 1 deletion backend/python/openvoice/requirements-intel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
intel-extension-for-pytorch
torch
optimum[openvino]
grpcio==1.63.0
grpcio==1.64.0
protobuf
librosa==0.9.1
faster-whisper==0.9.0
Expand Down
2 changes: 1 addition & 1 deletion backend/python/openvoice/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
grpcio==1.63.0
grpcio==1.64.0
protobuf
librosa==0.9.1
faster-whisper==0.9.0
Expand Down
2 changes: 1 addition & 1 deletion backend/python/parler-tts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
accelerate
grpcio==1.63.0
grpcio==1.64.0
protobuf
torch
git+https://github.com/huggingface/parler-tts.git@10016fb0300c0dc31a0fb70e26f3affee7b62f16
Expand Down
2 changes: 1 addition & 1 deletion backend/python/rerankers/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accelerate
rerankers[transformers]
grpcio==1.63.0
grpcio==1.64.0
protobuf
certifi
transformers
2 changes: 1 addition & 1 deletion backend/python/sentencetransformers/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accelerate
sentence-transformers==2.5.1
transformers
grpcio==1.63.0
grpcio==1.64.0
protobuf
certifi
2 changes: 1 addition & 1 deletion backend/python/transformers-musicgen/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accelerate
transformers
grpcio==1.63.0
grpcio==1.64.0
protobuf
torch
scipy==1.13.0
Expand Down
2 changes: 1 addition & 1 deletion backend/python/transformers/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accelerate
transformers
grpcio==1.63.0
grpcio==1.64.0
protobuf
torch
certifi
2 changes: 1 addition & 1 deletion backend/python/vall-e-x/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accelerate
grpcio==1.63.0
grpcio==1.64.0
protobuf
certifi
2 changes: 1 addition & 1 deletion backend/python/vllm/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accelerate
vllm
grpcio==1.63.0
grpcio==1.64.0
protobuf
certifi
transformers
Expand Down
24 changes: 24 additions & 0 deletions core/config/backend_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package config

import (
"os"
"regexp"
"strings"

"github.com/go-skynet/LocalAI/core/schema"
"github.com/go-skynet/LocalAI/pkg/downloader"
Expand Down Expand Up @@ -356,3 +358,25 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
cfg.Debug = &trueV
}
}

func (c *BackendConfig) Validate() bool {
// Simple validation to make sure the model can be correctly loaded
for _, n := range []string{c.Backend, c.Model} {
if strings.HasPrefix(n, string(os.PathSeparator)) ||
strings.Contains(n, "..") {
return false
}
}

if c.Name == "" {
return false
}

if c.Backend != "" {
// a regex that checks that is a string name with no special characters, except '-' and '_'
re := regexp.MustCompile(`^[a-zA-Z0-9-_]+$`)
return re.MatchString(c.Backend)
}

return true
}
21 changes: 17 additions & 4 deletions core/config/backend_config_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ func (cm *BackendConfigLoader) LoadBackendConfigFile(file string, opts ...Config
}

for _, cc := range c {
cm.configs[cc.Name] = *cc
if cc.Validate() {
cm.configs[cc.Name] = *cc
}
}
return nil
}
Expand All @@ -156,7 +158,12 @@ func (cl *BackendConfigLoader) LoadBackendConfig(file string, opts ...ConfigLoad
return fmt.Errorf("cannot read config file: %w", err)
}

cl.configs[c.Name] = *c
if c.Validate() {
cl.configs[c.Name] = *c
} else {
return fmt.Errorf("config is not valid")
}

return nil
}

Expand Down Expand Up @@ -297,7 +304,7 @@ func (cm *BackendConfigLoader) LoadBackendConfigsFromPath(path string, opts ...C
defer cm.Unlock()
entries, err := os.ReadDir(path)
if err != nil {
return err
return fmt.Errorf("cannot read directory '%s': %w", path, err)
}
files := make([]fs.FileInfo, 0, len(entries))
for _, entry := range entries {
Expand All @@ -314,8 +321,14 @@ func (cm *BackendConfigLoader) LoadBackendConfigsFromPath(path string, opts ...C
continue
}
c, err := ReadBackendConfig(filepath.Join(path, file.Name()), opts...)
if err == nil {
if err != nil {
log.Error().Err(err).Msgf("cannot read config file: %s", file.Name())
continue
}
if c.Validate() {
cm.configs[c.Name] = *c
} else {
log.Error().Err(err).Msgf("config is not valid")
}
}

Expand Down
Loading

0 comments on commit 1a3dede

Please sign in to comment.