Skip to content

Commit cd7617f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into jax-native
2 parents ed130b2 + f0006d8 commit cd7617f

23 files changed

Lines changed: 751 additions & 287 deletions

.github/workflows/actions.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,25 @@ jobs:
2929
version: keras-nightly
3030
- backend: openvino
3131
version: keras-nightly
32-
runs-on: ubuntu-latest
32+
33+
container:
34+
image: python:3.11-slim
35+
36+
runs-on: linux-x86-n2-16
37+
timeout-minutes: 120
3338
env:
3439
KERAS_BACKEND: ${{ matrix.backend }}
3540
steps:
36-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
37-
with:
38-
persist-credentials: false
39-
- name: Set up Python 3.11
40-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
41-
with:
42-
python-version: '3.11'
43-
- name: Get pip cache dir
44-
id: pip-cache
41+
- name: Install binary dependencies
42+
# build-essential for C extensions (tokenizers, torch)
43+
# curl, git, gnupg for checkout and other actions
4544
run: |
46-
python -m pip install --upgrade pip setuptools
47-
echo "::set-output name=dir::$(pip cache dir)"
48-
- name: pip cache
49-
# zizmor: ignore[cache-poisoning]
50-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
45+
apt-get update
46+
apt-get -y install build-essential curl git gnupg
47+
git config --global --add safe.directory '*'
48+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
5149
with:
52-
path: ${{ steps.pip-cache.outputs.dir }}
53-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-common.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('pyproject.toml') }}
50+
persist-credentials: false
5451
- name: Install dependencies
5552
run: |
5653
pip install -r requirements.txt --progress-bar off
@@ -68,7 +65,7 @@ jobs:
6865
pip install keras-nightly --no-cache-dir --progress-bar off
6966
- name: Test with pytest
7067
run: |
71-
pytest keras_hub/
68+
pytest keras_hub/ -n auto --dist loadfile --durations=50
7269
- name: Run integration tests
7370
run: |
7471
python pip_build.py --install
@@ -82,7 +79,7 @@ jobs:
8279
name: Check the code format
8380
runs-on: ubuntu-latest
8481
steps:
85-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
82+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
8683
with:
8784
persist-credentials: false
8885
- name: Set up Python 3.11

.github/workflows/auto-assignment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
welcome:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
19+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2020
with:
2121
persist-credentials: false
2222
ref: ${{ github.event.repository.default_branch }}
23-
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
23+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
2424
with:
2525
script: |
2626
const script = require('./\.github/workflows/scripts/auto-assignment.js')

.github/workflows/gemini-automated-issue-triage.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
id: 'get_issue_data'
5656
if: |-
5757
github.event_name == 'workflow_dispatch'
58-
uses: 'actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3' # v9
58+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
5959
env:
6060
ISSUE_NUMBER: '${{ github.event.inputs.issue_number || inputs.issue_number }}'
6161
with:
@@ -73,13 +73,13 @@ jobs:
7373
return issue;
7474
7575
- name: 'Checkout'
76-
uses: 'actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0' # v7
76+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
7777
with:
7878
persist-credentials: false
7979

8080
- name: 'Get Repository Labels'
8181
id: 'get_labels'
82-
uses: 'actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3' # v9
82+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
8383
with:
8484
github-token: '${{ secrets.GITHUB_TOKEN }}'
8585
script: |-
@@ -115,7 +115,7 @@ jobs:
115115
${{ github.event_name == 'workflow_dispatch' && steps.get_issue_data.outputs.title || github.event.issue.title }}
116116
ISSUE_BODY: >-
117117
${{ github.event_name == 'workflow_dispatch' && steps.get_issue_data.outputs.body || github.event.issue.body }}
118-
uses: 'actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3' # v9
118+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
119119
with:
120120
github-token: '${{ secrets.GITHUB_TOKEN }}'
121121
script: |-
@@ -160,7 +160,7 @@ jobs:
160160
run: mkdir -p ~/.gemini
161161

162162
- name: 'Run Gemini Issue Analysis & Response'
163-
uses: 'google-github-actions/run-gemini-cli@f77273f4c914e4bf38440cf36a0369cb64a37489'
163+
uses: google-github-actions/run-gemini-cli@f77273f4c914e4bf38440cf36a0369cb64a37489
164164
id: 'gemini_issue_analysis'
165165
env:
166166
GITHUB_TOKEN: '' # Do not pass any auth token here
@@ -233,7 +233,7 @@ jobs:
233233
ISSUE_NUMBER: '${{ github.event.issue.number || github.event.inputs.issue_number }}'
234234
LABELS_OUTPUT: '${{ steps.gemini_issue_analysis.outputs.summary }}'
235235
ALLOWED_LABELS: '${{ steps.get_labels.outputs.available_labels }}'
236-
uses: 'actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3' # v9
236+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
237237
with:
238238
github-token: '${{ secrets.GITHUB_TOKEN }}'
239239
script: |

.github/workflows/labeler.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
welcome:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
17+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1818
with:
1919
persist-credentials: false
2020
ref: ${{ github.event.repository.default_branch }}
21-
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
21+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
2222
with:
2323
script: |
2424
const script = require('./\.github/workflows/scripts/labeler.js')

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
needs: [run-test-for-nightly]
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
19+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2020
with:
2121
persist-credentials: false
2222
- name: Set up Python

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Build and publish to PyPI
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
13+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1414
with:
1515
persist-credentials: false
1616
- name: Set up Python

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: "Checkout code"
28-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
28+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2929
with:
3030
persist-credentials: false
3131

.github/workflows/zizmor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
17+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1818
with:
1919
persist-credentials: false
2020

keras_hub/api/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@
511511
from keras_hub.src.models.mistral.mistral_causal_lm_preprocessor import (
512512
MistralCausalLMPreprocessor as MistralCausalLMPreprocessor,
513513
)
514+
from keras_hub.src.models.mistral.mistral_tokenizer import (
515+
MistralTekkenTokenizer as MistralTekkenTokenizer,
516+
)
514517
from keras_hub.src.models.mistral.mistral_tokenizer import (
515518
MistralTokenizer as MistralTokenizer,
516519
)

keras_hub/api/tokenizers/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
from keras_hub.src.models.metaclip_2.metaclip_2_tokenizer import (
7272
MetaCLIP2Tokenizer as MetaCLIP2Tokenizer,
7373
)
74+
from keras_hub.src.models.mistral.mistral_tokenizer import (
75+
MistralTekkenTokenizer as MistralTekkenTokenizer,
76+
)
7477
from keras_hub.src.models.mistral.mistral_tokenizer import (
7578
MistralTokenizer as MistralTokenizer,
7679
)

0 commit comments

Comments
 (0)