Skip to content

Commit

Permalink
Merge pull request #318 from ndif-team/dev0.4
Browse files Browse the repository at this point in the history
Dev0.4
  • Loading branch information
JadenFiotto-Kaufman authored Jan 31, 2025
2 parents 98114e2 + b2a0c47 commit 824c0a8
Show file tree
Hide file tree
Showing 124 changed files with 8,192 additions and 10,545 deletions.
20 changes: 19 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import pytest
import toml

def pytest_addoption(parser):
parser.addoption("--device", action="store", default="cuda:0")

parser.addoption(
"--tp",
action="store",
type=int,
default="1",
help="An argument for specifying the number of gpus to be used by VLLM"
)

def pytest_generate_tests(metafunc):
# This is called for every test. Only get/set command line arguments
Expand All @@ -9,5 +18,14 @@ def pytest_generate_tests(metafunc):
if "device" in metafunc.fixturenames and option_value is not None:
metafunc.parametrize("device", [option_value], scope="module")

@pytest.fixture(scope="session")
def load_pyproject_toml():
"""Fixture to load and parse the pyproject.toml file."""
try:
with open("pyproject.toml", "r") as f:
data = toml.load(f)
return data
except toml.TomlDecodeError as e:
pytest.fail(f"Failed to load pyproject.toml: {e}")

collect_ignore = ["examples/test_server.py", "examples/test_server_llama.py"]
28 changes: 23 additions & 5 deletions pyproject.toml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[project]
Expand All @@ -11,15 +12,18 @@ authors = [
]
description = "Package for interpreting and manipulating the internals of deep learning models."
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.7"
license = { text = "MIT License" }

classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

dependencies = [
"transformers",
"protobuf",
"protobuf",
"python-socketio[client]",
"tokenizers>=0.13.0",
"pydantic>=2.9.0",
Expand All @@ -28,14 +32,28 @@ dependencies = [
"torchvision",
"accelerate",
"diffusers",
"einops"
"einops",
"msgspec",
"toml",
"ipython",
]

[project.optional-dependencies]
test = [
"pytest",
"toml"
]

[project.urls]
"Homepage" = "https://github.com/ndif-team/nnsight"
"Website" = "https://nnsight.net/"
"Documentation" = "https://nnsight.net/documentation/"
"Changelog" = "https://github.com/ndif-team/nnsight/CHANGELOG.md"
"Releases" = "https://github.com/ndif-team/nnsight/releases"

[tool.setuptools]
include-package-data = true
license-files = ["LICENSE"]

[tool.setuptools.package-data]
nnsight = ["config.yaml", "nnsight.log"]


3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
config: mark a test as part of configuration tests
Loading

0 comments on commit 824c0a8

Please sign in to comment.