Skip to content

Commit 91c7664

Browse files
author
Guang Yang
committed
Enable t5 and similar models
1 parent 2b65e30 commit 91c7664

30 files changed

+1854
-320
lines changed

.github/workflows/test_export.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/test_models.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ExecuTorch Runtime / Python - Test
1+
name: ExecuTorch E2E / Python - Test
22

33
on:
44
push:
@@ -15,23 +15,39 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ['3.10', '3.11', '3.12']
19-
os: [macos-15]
2018
test-modeling:
21-
- test_modeling_gemma2.py
19+
- test_modeling.py
20+
- test_modeling_albert.py
21+
- test_modeling_bert.py
22+
- test_modeling_distilbert.py
23+
- test_modeling_eurobert.py
2224
- test_modeling_gemma.py
25+
- test_modeling_gemma2.py
2326
- test_modeling_llama.py
2427
- test_modeling_olmo.py
25-
- test_modeling.py
2628
- test_modeling_qwen2.py
29+
- test_modeling_roberta.py
30+
- test_modeling_t5.py
31+
executorch-version: ['0.4.0', 'nightly']
32+
python-version: ['3.10', '3.11', '3.12']
33+
os: [macos-15]
34+
35+
# Custom job name, now shortened and cleaner
36+
name: build (${{ env.MODEL_NAME }}, et=${{ matrix.executorch-version }}, py=${{ matrix.python-version }}, matrix.os)
2737

2838
runs-on: ${{ matrix.os }}
39+
env:
40+
MODEL_NAME: ${{ matrix.test-modeling }}
2941
steps:
3042
- uses: actions/checkout@v2
3143
- name: Setup Python ${{ matrix.python-version }}
3244
uses: actions/setup-python@v2
3345
with:
3446
python-version: ${{ matrix.python-version }}
47+
# Extract the model name from "test_modeling_<model>.py"
48+
- name: Format model name
49+
run: |
50+
echo "MODEL_NAME=$(echo $MODEL_NAME | sed -E 's/test_modeling_(.*)\.py/\1/')" >> $GITHUB_ENV
3551
- name: Install dependencies for ExecuTorch
3652
run: |
3753
pip install .[tests]

optimum/executorch/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@
2020
_import_structure = {
2121
"modeling": [
2222
"ExecuTorchModelForCausalLM",
23+
"ExecuTorchModelForMaskedLM",
24+
"ExecuTorchModelForSeq2SeqLM",
2325
],
2426
}
2527

2628
if TYPE_CHECKING:
27-
from .modeling import ExecuTorchModelForCausalLM
29+
from .modeling import (
30+
ExecuTorchModelForCausalLM,
31+
ExecuTorchModelForMaskedLM,
32+
ExecuTorchModelForSeq2SeqLM,
33+
)
2834
else:
2935
import sys
3036

0 commit comments

Comments
 (0)