Skip to content

Commit 3becf08

Browse files
committed
have a language model address #348
1 parent f6bc14c commit 3becf08

File tree

6 files changed

+71
-51
lines changed

6 files changed

+71
-51
lines changed

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222
- name: Set up Python
23-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v5
2424
with:
2525
python-version: '3.x'
2626
- name: Install dependencies

.github/workflows/python-test.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,17 @@ jobs:
1818
python-version: [3.8, 3.9]
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v5
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
python -m pip install pytest
30-
python -m pip install wheel
3129
python -m pip install torch==2.4.0 torchvision==0.19.0 --index-url https://download.pytorch.org/whl/cpu
32-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+
python -m pip install -e .
31+
python -m pip install pytest
3332
- name: Test with pytest
3433
run: |
35-
python setup.py test
34+
pytest -q

pyproject.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[build-system]
2+
requires = ["setuptools>=61", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "vit-pytorch"
7+
version = "1.12.4"
8+
description = "Vision Transformer (ViT) - Pytorch"
9+
readme = { file = "README.md", content-type = "text/markdown" }
10+
license = { file = "LICENSE" }
11+
authors = [
12+
{ name = "Phil Wang", email = "lucidrains@gmail.com" },
13+
]
14+
requires-python = ">=3.8"
15+
keywords = [
16+
"artificial intelligence",
17+
"attention mechanism",
18+
"image recognition",
19+
]
20+
classifiers = [
21+
"Development Status :: 4 - Beta",
22+
"Intended Audience :: Developers",
23+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
24+
"License :: OSI Approved :: MIT License",
25+
"Programming Language :: Python :: 3",
26+
"Programming Language :: Python :: 3 :: Only",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
]
33+
dependencies = [
34+
"einops>=0.7.0",
35+
"torch>=1.10",
36+
"torchvision",
37+
]
38+
39+
[project.optional-dependencies]
40+
test = [
41+
"pytest",
42+
"torch==2.4.0",
43+
"torchvision==0.19.0",
44+
]
45+
46+
[project.urls]
47+
Homepage = "https://github.com/lucidrains/vit-pytorch"
48+
Repository = "https://github.com/lucidrains/vit-pytorch"
49+
50+
[tool.setuptools]
51+
include-package-data = true
52+
53+
[tool.setuptools.packages.find]
54+
include = ["vit_pytorch*"]
55+
exclude = ["examples*", "tests*", "test*"]
56+
57+
[tool.pytest.ini_options]
58+
testpaths = ["tests", "."]
59+
python_files = ["test_*.py", "*_test.py"]
60+
addopts = "-q"
61+
filterwarnings = [
62+
"ignore::FutureWarning",
63+
]

setup.py

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

tests/.DS_Store

6 KB
Binary file not shown.

tests/test.py renamed to tests/test_vit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import torch
22
from vit_pytorch import ViT
33

4-
def test():
4+
def test_vit():
55
v = ViT(
66
image_size = 256,
77
patch_size = 32,

0 commit comments

Comments
 (0)