otat 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
otat-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.4
2
+ Name: otat
3
+ Version: 0.1.0
4
+ Summary: Vision-Language Model Interpretability Analysis - One Token at a Time
5
+ Author-email: Your Name <your.email@example.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/varungupta31/otat_api
8
+ Project-URL: Repository, https://github.com/varungupta31/otat_api
9
+ Project-URL: Documentation, https://github.com/varungupta31/otat_api#readme
10
+ Keywords: interpretability,vision-language-models,attention,llava,qwen
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: torch>=2.0.0
22
+ Requires-Dist: torchvision
23
+ Requires-Dist: transformers==4.57.0
24
+ Requires-Dist: accelerate
25
+ Requires-Dist: pandas
26
+ Requires-Dist: numpy
27
+ Requires-Dist: pillow
28
+ Requires-Dist: pyyaml
29
+ Requires-Dist: tqdm
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
32
+ Requires-Dist: black>=23.0.0; extra == "dev"
33
+ Requires-Dist: isort>=5.12.0; extra == "dev"
34
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
35
+ Provides-Extra: api
36
+ Requires-Dist: fastapi>=0.104.0; extra == "api"
37
+ Requires-Dist: uvicorn>=0.24.0; extra == "api"
38
+ Dynamic: requires-python
39
+
40
+ # Interpretability Core
41
+
42
+ Vision-Language Model Interpretability Analysis toolkit for analyzing attention patterns in models like LLaVA and Qwen-VL.
43
+
44
+ ## Installation
45
+
46
+ ### From PyPI (when published)
47
+ ```bash
48
+ pip install otat
49
+ ```
50
+
51
+ ### From GitHub
52
+ ```bash
53
+ pip install git@github.com:varungupta31/otat_api.git
54
+ ```
55
+
56
+ ### Local Development
57
+ ```bash
58
+ git clone https://github.com/varungupta31/otat_api.git
59
+ cd otat_api
60
+ pip install -e .
61
+ ```
62
+
63
+ ## Quick Start
64
+ ```python
65
+ from interpretability.api.wrapper import InterpretabilityAnalyzer
66
+
67
+ # Initialize analyzer
68
+ analyzer = InterpretabilityAnalyzer(
69
+ model_type="llava_onevision",
70
+ model_id="llava-hf/llava-onevision-qwen2-0.5b-ov-hf"
71
+ )
72
+
73
+ # Run analysis
74
+ result = analyzer.analyze(
75
+ image_path="path/to/image.jpg",
76
+ task_text="What is in this image?",
77
+ instruction="Answer briefly.",
78
+ blocking_mode="none",
79
+ num_tokens=20
80
+ )
81
+
82
+ print(result['output_tokens'])
83
+ print(result['series']) # Attention patterns
84
+ ```
85
+
86
+ ## Features
87
+
88
+ - πŸ” Attention pattern analysis for VLMs
89
+ - 🎯 Support for LLaVA, Qwen-VL, and Qwen2-LLM
90
+ - 🚫 Attention blocking experiments
91
+ - πŸ“Š Token-level attention aggregation
92
+
93
+ ## License
94
+
95
+ MIT
96
+ ```
97
+
98
+ ---
99
+
100
+ ## **3. Verify Your Project Structure**
101
+
102
+ Make sure it looks like this:
103
+ ```
104
+ otat_api/ (or interpretability-core/)
105
+ β”œβ”€β”€ pyproject.toml # βœ… Just created
106
+ β”œβ”€β”€ README.md # βœ… Just created
107
+ β”œβ”€β”€ LICENSE # Optional but recommended
108
+ β”œβ”€β”€ .gitignore # Recommended
109
+ β”œβ”€β”€ src/
110
+ β”‚ └── interpretability/
111
+ β”‚ β”œβ”€β”€ __init__.py # ⚠️ Make sure this exists!
112
+ β”‚ β”œβ”€β”€ api/
113
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
114
+ β”‚ β”‚ └── wrapper.py
115
+ β”‚ β”œβ”€β”€ models/
116
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
117
+ β”‚ β”‚ β”œβ”€β”€ base_handler.py
118
+ β”‚ β”‚ β”œβ”€β”€ llava_onevision.py
119
+ β”‚ β”‚ β”œβ”€β”€ qwen2_llm.py
120
+ β”‚ β”‚ └── qwen_25_vl.py
121
+ β”‚ β”œβ”€β”€ tasks/
122
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
123
+ β”‚ β”‚ β”œβ”€β”€ base_task.py
124
+ β”‚ β”‚ β”œβ”€β”€ web_api_task.py
125
+ β”‚ β”‚ └── ...
126
+ β”‚ β”œβ”€β”€ analysis/
127
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
128
+ β”‚ β”‚ β”œβ”€β”€ extractor_aggregated.py
129
+ β”‚ β”‚ └── ...
130
+ β”‚ β”œβ”€β”€ utils/
131
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
132
+ β”‚ β”‚ └── ...
133
+ β”‚ └── prompts/
134
+ β”‚ └── ...
135
+ └── scripts/
136
+ └── run_analysis.py
otat-0.1.0/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # Interpretability Core
2
+
3
+ Vision-Language Model Interpretability Analysis toolkit for analyzing attention patterns in models like LLaVA and Qwen-VL.
4
+
5
+ ## Installation
6
+
7
+ ### From PyPI (when published)
8
+ ```bash
9
+ pip install otat
10
+ ```
11
+
12
+ ### From GitHub
13
+ ```bash
14
+ pip install git@github.com:varungupta31/otat_api.git
15
+ ```
16
+
17
+ ### Local Development
18
+ ```bash
19
+ git clone https://github.com/varungupta31/otat_api.git
20
+ cd otat_api
21
+ pip install -e .
22
+ ```
23
+
24
+ ## Quick Start
25
+ ```python
26
+ from interpretability.api.wrapper import InterpretabilityAnalyzer
27
+
28
+ # Initialize analyzer
29
+ analyzer = InterpretabilityAnalyzer(
30
+ model_type="llava_onevision",
31
+ model_id="llava-hf/llava-onevision-qwen2-0.5b-ov-hf"
32
+ )
33
+
34
+ # Run analysis
35
+ result = analyzer.analyze(
36
+ image_path="path/to/image.jpg",
37
+ task_text="What is in this image?",
38
+ instruction="Answer briefly.",
39
+ blocking_mode="none",
40
+ num_tokens=20
41
+ )
42
+
43
+ print(result['output_tokens'])
44
+ print(result['series']) # Attention patterns
45
+ ```
46
+
47
+ ## Features
48
+
49
+ - πŸ” Attention pattern analysis for VLMs
50
+ - 🎯 Support for LLaVA, Qwen-VL, and Qwen2-LLM
51
+ - 🚫 Attention blocking experiments
52
+ - πŸ“Š Token-level attention aggregation
53
+
54
+ ## License
55
+
56
+ MIT
57
+ ```
58
+
59
+ ---
60
+
61
+ ## **3. Verify Your Project Structure**
62
+
63
+ Make sure it looks like this:
64
+ ```
65
+ otat_api/ (or interpretability-core/)
66
+ β”œβ”€β”€ pyproject.toml # βœ… Just created
67
+ β”œβ”€β”€ README.md # βœ… Just created
68
+ β”œβ”€β”€ LICENSE # Optional but recommended
69
+ β”œβ”€β”€ .gitignore # Recommended
70
+ β”œβ”€β”€ src/
71
+ β”‚ └── interpretability/
72
+ β”‚ β”œβ”€β”€ __init__.py # ⚠️ Make sure this exists!
73
+ β”‚ β”œβ”€β”€ api/
74
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
75
+ β”‚ β”‚ └── wrapper.py
76
+ β”‚ β”œβ”€β”€ models/
77
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
78
+ β”‚ β”‚ β”œβ”€β”€ base_handler.py
79
+ β”‚ β”‚ β”œβ”€β”€ llava_onevision.py
80
+ β”‚ β”‚ β”œβ”€β”€ qwen2_llm.py
81
+ β”‚ β”‚ └── qwen_25_vl.py
82
+ β”‚ β”œβ”€β”€ tasks/
83
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
84
+ β”‚ β”‚ β”œβ”€β”€ base_task.py
85
+ β”‚ β”‚ β”œβ”€β”€ web_api_task.py
86
+ β”‚ β”‚ └── ...
87
+ β”‚ β”œβ”€β”€ analysis/
88
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
89
+ β”‚ β”‚ β”œβ”€β”€ extractor_aggregated.py
90
+ β”‚ β”‚ └── ...
91
+ β”‚ β”œβ”€β”€ utils/
92
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
93
+ β”‚ β”‚ └── ...
94
+ β”‚ └── prompts/
95
+ β”‚ └── ...
96
+ └── scripts/
97
+ └── run_analysis.py
@@ -0,0 +1,66 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "otat"
7
+ version = "0.1.0"
8
+ description = "Vision-Language Model Interpretability Analysis - One Token at a Time"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "Your Name", email = "your.email@example.com"}
14
+ ]
15
+ keywords = ["interpretability", "vision-language-models", "attention", "llava", "qwen"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Science/Research",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.8",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
25
+ ]
26
+
27
+ dependencies = [
28
+ "torch>=2.0.0",
29
+ "torchvision",
30
+ "transformers==4.57.0",
31
+ "accelerate",
32
+ "pandas",
33
+ "numpy",
34
+ "pillow",
35
+ "pyyaml",
36
+ "tqdm",
37
+ ]
38
+
39
+ [project.optional-dependencies]
40
+ dev = [
41
+ "pytest>=7.0.0",
42
+ "black>=23.0.0",
43
+ "isort>=5.12.0",
44
+ "flake8>=6.0.0",
45
+ ]
46
+ api = [
47
+ "fastapi>=0.104.0",
48
+ "uvicorn>=0.24.0",
49
+ ]
50
+
51
+ [project.urls]
52
+ Homepage = "https://github.com/varungupta31/otat_api"
53
+ Repository = "https://github.com/varungupta31/otat_api"
54
+ Documentation = "https://github.com/varungupta31/otat_api#readme"
55
+
56
+ [tool.setuptools]
57
+ packages = ["interpretability"]
58
+ package-dir = {"" = "src"}
59
+
60
+ [tool.black]
61
+ line-length = 100
62
+ target-version = ['py38', 'py39', 'py310']
63
+
64
+ [tool.isort]
65
+ profile = "black"
66
+ line_length = 100
otat-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
otat-0.1.0/setup.py ADDED
@@ -0,0 +1,18 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="interpretability-core",
5
+ version="0.1.0",
6
+ packages=find_packages(where="src"),
7
+ package_dir={"": "src"},
8
+ install_requires=[
9
+ "torch",
10
+ "transformers",
11
+ "pandas",
12
+ "pyyaml",
13
+ "pillow",
14
+ "tqdm",
15
+ # ... other dependencies
16
+ ],
17
+ python_requires=">=3.10",
18
+ )
@@ -0,0 +1,9 @@
1
+ """
2
+ Interpretability Core - VLM Attention Analysis Toolkit
3
+ """
4
+
5
+ __version__ = "0.1.0"
6
+
7
+ from .api.wrapper import InterpretabilityAnalyzer
8
+
9
+ __all__ = ["InterpretabilityAnalyzer"]
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.4
2
+ Name: otat
3
+ Version: 0.1.0
4
+ Summary: Vision-Language Model Interpretability Analysis - One Token at a Time
5
+ Author-email: Your Name <your.email@example.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/varungupta31/otat_api
8
+ Project-URL: Repository, https://github.com/varungupta31/otat_api
9
+ Project-URL: Documentation, https://github.com/varungupta31/otat_api#readme
10
+ Keywords: interpretability,vision-language-models,attention,llava,qwen
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: torch>=2.0.0
22
+ Requires-Dist: torchvision
23
+ Requires-Dist: transformers==4.57.0
24
+ Requires-Dist: accelerate
25
+ Requires-Dist: pandas
26
+ Requires-Dist: numpy
27
+ Requires-Dist: pillow
28
+ Requires-Dist: pyyaml
29
+ Requires-Dist: tqdm
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
32
+ Requires-Dist: black>=23.0.0; extra == "dev"
33
+ Requires-Dist: isort>=5.12.0; extra == "dev"
34
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
35
+ Provides-Extra: api
36
+ Requires-Dist: fastapi>=0.104.0; extra == "api"
37
+ Requires-Dist: uvicorn>=0.24.0; extra == "api"
38
+ Dynamic: requires-python
39
+
40
+ # Interpretability Core
41
+
42
+ Vision-Language Model Interpretability Analysis toolkit for analyzing attention patterns in models like LLaVA and Qwen-VL.
43
+
44
+ ## Installation
45
+
46
+ ### From PyPI (when published)
47
+ ```bash
48
+ pip install otat
49
+ ```
50
+
51
+ ### From GitHub
52
+ ```bash
53
+ pip install git@github.com:varungupta31/otat_api.git
54
+ ```
55
+
56
+ ### Local Development
57
+ ```bash
58
+ git clone https://github.com/varungupta31/otat_api.git
59
+ cd otat_api
60
+ pip install -e .
61
+ ```
62
+
63
+ ## Quick Start
64
+ ```python
65
+ from interpretability.api.wrapper import InterpretabilityAnalyzer
66
+
67
+ # Initialize analyzer
68
+ analyzer = InterpretabilityAnalyzer(
69
+ model_type="llava_onevision",
70
+ model_id="llava-hf/llava-onevision-qwen2-0.5b-ov-hf"
71
+ )
72
+
73
+ # Run analysis
74
+ result = analyzer.analyze(
75
+ image_path="path/to/image.jpg",
76
+ task_text="What is in this image?",
77
+ instruction="Answer briefly.",
78
+ blocking_mode="none",
79
+ num_tokens=20
80
+ )
81
+
82
+ print(result['output_tokens'])
83
+ print(result['series']) # Attention patterns
84
+ ```
85
+
86
+ ## Features
87
+
88
+ - πŸ” Attention pattern analysis for VLMs
89
+ - 🎯 Support for LLaVA, Qwen-VL, and Qwen2-LLM
90
+ - 🚫 Attention blocking experiments
91
+ - πŸ“Š Token-level attention aggregation
92
+
93
+ ## License
94
+
95
+ MIT
96
+ ```
97
+
98
+ ---
99
+
100
+ ## **3. Verify Your Project Structure**
101
+
102
+ Make sure it looks like this:
103
+ ```
104
+ otat_api/ (or interpretability-core/)
105
+ β”œβ”€β”€ pyproject.toml # βœ… Just created
106
+ β”œβ”€β”€ README.md # βœ… Just created
107
+ β”œβ”€β”€ LICENSE # Optional but recommended
108
+ β”œβ”€β”€ .gitignore # Recommended
109
+ β”œβ”€β”€ src/
110
+ β”‚ └── interpretability/
111
+ β”‚ β”œβ”€β”€ __init__.py # ⚠️ Make sure this exists!
112
+ β”‚ β”œβ”€β”€ api/
113
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
114
+ β”‚ β”‚ └── wrapper.py
115
+ β”‚ β”œβ”€β”€ models/
116
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
117
+ β”‚ β”‚ β”œβ”€β”€ base_handler.py
118
+ β”‚ β”‚ β”œβ”€β”€ llava_onevision.py
119
+ β”‚ β”‚ β”œβ”€β”€ qwen2_llm.py
120
+ β”‚ β”‚ └── qwen_25_vl.py
121
+ β”‚ β”œβ”€β”€ tasks/
122
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
123
+ β”‚ β”‚ β”œβ”€β”€ base_task.py
124
+ β”‚ β”‚ β”œβ”€β”€ web_api_task.py
125
+ β”‚ β”‚ └── ...
126
+ β”‚ β”œβ”€β”€ analysis/
127
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
128
+ β”‚ β”‚ β”œβ”€β”€ extractor_aggregated.py
129
+ β”‚ β”‚ └── ...
130
+ β”‚ β”œβ”€β”€ utils/
131
+ β”‚ β”‚ β”œβ”€β”€ __init__.py
132
+ β”‚ β”‚ └── ...
133
+ β”‚ └── prompts/
134
+ β”‚ └── ...
135
+ └── scripts/
136
+ └── run_analysis.py
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ src/interpretability/__init__.py
5
+ src/otat.egg-info/PKG-INFO
6
+ src/otat.egg-info/SOURCES.txt
7
+ src/otat.egg-info/dependency_links.txt
8
+ src/otat.egg-info/requires.txt
9
+ src/otat.egg-info/top_level.txt
@@ -0,0 +1,19 @@
1
+ torch>=2.0.0
2
+ torchvision
3
+ transformers==4.57.0
4
+ accelerate
5
+ pandas
6
+ numpy
7
+ pillow
8
+ pyyaml
9
+ tqdm
10
+
11
+ [api]
12
+ fastapi>=0.104.0
13
+ uvicorn>=0.24.0
14
+
15
+ [dev]
16
+ pytest>=7.0.0
17
+ black>=23.0.0
18
+ isort>=5.12.0
19
+ flake8>=6.0.0
@@ -0,0 +1 @@
1
+ interpretability