Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions models/clap/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "transformers==4.57.3",
# ]
#
Expand Down
4 changes: 2 additions & 2 deletions models/clip/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "transformers==4.57.3",
# ]
#
Expand Down
4 changes: 2 additions & 2 deletions models/depth-anything/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "depth-anything-3 @ git+https://github.com/ByteDance-Seed/Depth-Anything-3.git",
# "scipy<1.15",
# ]
Expand Down
4 changes: 2 additions & 2 deletions models/edsr/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "torchsr",
# ]
#
Expand Down
6 changes: 3 additions & 3 deletions models/efficient-sam/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "efficient-sam @ git+https://github.com/yformer/EfficientSAM.git",
# "torch<=2.11.0"
# ]
Expand Down Expand Up @@ -235,7 +235,7 @@ def main():
parser.add_argument(
"--num-pts",
type=int,
default=1,
default=2,
help=(
"Number of points per query (P dim of batched_points). Use 1 for a single "
"point prompt, or 2 with labels [2, 3] for a box prompt (top-left + "
Expand Down
12 changes: 7 additions & 5 deletions models/pvt/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "timm",
# ]
#
Expand All @@ -27,9 +27,11 @@
from coreai_torch import TorchConverter, get_decomp_table


def reference_inputs(dynamic: bool = False) -> dict[str, torch.Tensor]:
def reference_inputs(
dynamic: bool = False, dtype: torch.dtype = torch.float32
) -> dict[str, torch.Tensor]:
B = 2 if dynamic else 1
return {"x": torch.randn(B, 3, 224, 224)}
return {"x": torch.randn(B, 3, 224, 224, dtype=dtype)}


def dynamic_shapes() -> dict:
Expand Down Expand Up @@ -97,7 +99,7 @@ def create_pvt(
model.to(dtype)
print("[INFO] Model sourced. Running torch export with decompositions...")

example_inputs = {k: v.to(dtype) for k, v in reference_inputs(dynamic).items()}
example_inputs = example_inputs = reference_inputs(dynamic, dtype)
ds = dynamic_shapes() if dynamic else None

with torch.autocast(device_type="cpu", dtype=dtype):
Expand Down
4 changes: 2 additions & 2 deletions models/roberta/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "transformers==4.57.3",
# ]
#
Expand Down
4 changes: 2 additions & 2 deletions models/sam3/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "tokenizers<0.23.0rc",
# "torchvision",
# "transformers>=5.5.4,<5.10.1",
Expand Down
4 changes: 2 additions & 2 deletions models/t5/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "transformers==4.57.3",
# ]
#
Expand Down
4 changes: 2 additions & 2 deletions models/wav2vec2/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "torchaudio",
# ]
#
Expand Down
4 changes: 2 additions & 2 deletions models/whisper/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "transformers==4.57.3",
# ]
#
Expand Down
4 changes: 2 additions & 2 deletions models/yolo/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "coreai-core==1.0.0b1",
# "coreai-torch==0.4.0",
# "coreai-core==1.0.0b2",
# "coreai-torch==0.4.1",
# "transformers==4.57.3",
# ]
#
Expand Down
6 changes: 3 additions & 3 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ requires-python = ">=3.11"
# `uv.lock` at the workspace root.
dependencies = [
"accelerate>=1.12,<2.0",
"coreai-core==1.0.0b1",
"coreai-torch==0.4.0",
"coreai-opt==0.2.0",
"coreai-core==1.0.0b2",
"coreai-torch==0.4.1",
"coreai-opt==0.2.1",
"torch==2.9.0",
"numpy>=2.2,<3.0",
"tqdm>=4.67,<5.0",
Expand Down
Loading