langvision 0.0.2__tar.gz → 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.

Potentially problematic release.


This version of langvision might be problematic. Click here for more details.

Files changed (90) hide show
  1. {langvision-0.0.2 → langvision-0.1.0}/MANIFEST.in +0 -1
  2. langvision-0.1.0/PKG-INFO +49 -0
  3. langvision-0.0.2/src/langvision.egg-info/PKG-INFO → langvision-0.1.0/README.md +126 -70
  4. langvision-0.1.0/docs/_config.yml +11 -0
  5. langvision-0.1.0/requirements.txt +34 -0
  6. langvision-0.1.0/setup.py +70 -0
  7. langvision-0.1.0/src/langvision/__init__.py +82 -0
  8. langvision-0.1.0/src/langvision/callbacks/base.py +170 -0
  9. langvision-0.1.0/src/langvision/cli/__init__.py +85 -0
  10. langvision-0.1.0/src/langvision/cli/complete_cli.py +319 -0
  11. langvision-0.1.0/src/langvision/cli/config.py +344 -0
  12. langvision-0.1.0/src/langvision/cli/evaluate.py +201 -0
  13. langvision-0.1.0/src/langvision/cli/export.py +177 -0
  14. langvision-0.1.0/src/langvision/cli/finetune.py +298 -0
  15. langvision-0.1.0/src/langvision/cli/model_zoo.py +162 -0
  16. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/cli/train.py +27 -13
  17. langvision-0.1.0/src/langvision/cli/utils.py +258 -0
  18. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/components/attention.py +4 -1
  19. langvision-0.1.0/src/langvision/concepts/__init__.py +9 -0
  20. langvision-0.1.0/src/langvision/concepts/ccot.py +30 -0
  21. langvision-0.1.0/src/langvision/concepts/cot.py +29 -0
  22. langvision-0.1.0/src/langvision/concepts/dpo.py +37 -0
  23. langvision-0.1.0/src/langvision/concepts/grpo.py +25 -0
  24. langvision-0.1.0/src/langvision/concepts/lime.py +37 -0
  25. langvision-0.1.0/src/langvision/concepts/ppo.py +47 -0
  26. langvision-0.1.0/src/langvision/concepts/rlhf.py +40 -0
  27. langvision-0.1.0/src/langvision/concepts/rlvr.py +25 -0
  28. langvision-0.1.0/src/langvision/concepts/shap.py +37 -0
  29. langvision-0.1.0/src/langvision/data/enhanced_datasets.py +582 -0
  30. langvision-0.1.0/src/langvision/model_zoo.py +169 -0
  31. langvision-0.1.0/src/langvision/models/lora.py +202 -0
  32. langvision-0.1.0/src/langvision/models/multimodal.py +297 -0
  33. langvision-0.1.0/src/langvision/models/resnet.py +303 -0
  34. langvision-0.1.0/src/langvision/training/advanced_trainer.py +478 -0
  35. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/training/trainer.py +30 -2
  36. langvision-0.1.0/src/langvision/utils/config.py +186 -0
  37. langvision-0.1.0/src/langvision/utils/metrics.py +448 -0
  38. langvision-0.1.0/src/langvision/utils/setup.py +266 -0
  39. langvision-0.1.0/src/langvision.egg-info/PKG-INFO +49 -0
  40. {langvision-0.0.2 → langvision-0.1.0}/src/langvision.egg-info/SOURCES.txt +25 -2
  41. langvision-0.1.0/src/langvision.egg-info/entry_points.txt +2 -0
  42. langvision-0.1.0/src/langvision.egg-info/not-zip-safe +1 -0
  43. langvision-0.1.0/src/langvision.egg-info/requires.txt +31 -0
  44. langvision-0.1.0/tests/test_vision_transformer.py +198 -0
  45. langvision-0.0.2/LICENSE +0 -21
  46. langvision-0.0.2/PKG-INFO +0 -372
  47. langvision-0.0.2/README.md +0 -330
  48. langvision-0.0.2/pyproject.toml +0 -38
  49. langvision-0.0.2/requirements.txt +0 -5
  50. langvision-0.0.2/src/langvision/__init__.py +0 -7
  51. langvision-0.0.2/src/langvision/callbacks/base.py +0 -11
  52. langvision-0.0.2/src/langvision/cli/finetune.py +0 -181
  53. langvision-0.0.2/src/langvision/model_zoo.py +0 -2
  54. langvision-0.0.2/src/langvision/models/lora.py +0 -30
  55. langvision-0.0.2/src/langvision/training/__init__.py +0 -0
  56. langvision-0.0.2/src/langvision/utils/config.py +0 -15
  57. langvision-0.0.2/src/langvision.egg-info/entry_points.txt +0 -2
  58. langvision-0.0.2/src/langvision.egg-info/requires.txt +0 -7
  59. langvision-0.0.2/tests/test_vision_transformer.py +0 -19
  60. {langvision-0.0.2 → langvision-0.1.0}/docs/index.md +0 -0
  61. {langvision-0.0.2 → langvision-0.1.0}/setup.cfg +0 -0
  62. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/agents/__init__.py +0 -0
  63. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/callbacks/__init__.py +0 -0
  64. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/callbacks/early_stopping.py +0 -0
  65. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/callbacks/logging.py +0 -0
  66. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/callbacks/registry.py +0 -0
  67. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/components/__init__.py +0 -0
  68. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/components/mlp.py +0 -0
  69. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/components/patch_embedding.py +0 -0
  70. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/config/__init__.py +0 -0
  71. {langvision-0.0.2/src/langvision/cli → langvision-0.1.0/src/langvision/data}/__init__.py +0 -0
  72. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/data/datasets.py +0 -0
  73. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/example.py +0 -0
  74. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/filesystem/__init__.py +0 -0
  75. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/llm/__init__.py +0 -0
  76. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/memory/__init__.py +0 -0
  77. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/models/__init__.py +0 -0
  78. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/models/vision_transformer.py +0 -0
  79. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/sync/__init__.py +0 -0
  80. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/telemetry/__init__.py +0 -0
  81. {langvision-0.0.2/src/langvision/data → langvision-0.1.0/src/langvision/training}/__init__.py +0 -0
  82. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/utils/__init__.py +0 -0
  83. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/utils/cuda.py +0 -0
  84. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/utils/data.py +0 -0
  85. {langvision-0.0.2 → langvision-0.1.0}/src/langvision/utils/device.py +0 -0
  86. {langvision-0.0.2 → langvision-0.1.0}/src/langvision.egg-info/dependency_links.txt +0 -0
  87. {langvision-0.0.2 → langvision-0.1.0}/src/langvision.egg-info/top_level.txt +0 -0
  88. {langvision-0.0.2 → langvision-0.1.0}/tests/test_example.py +0 -0
  89. {langvision-0.0.2 → langvision-0.1.0}/tests/test_lora.py +0 -0
  90. {langvision-0.0.2 → langvision-0.1.0}/tests/test_version.py +0 -0
@@ -1,4 +1,3 @@
1
- include LICENSE
2
1
  include README.md
3
2
  include requirements.txt
4
3
  recursive-include docs *
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.1
2
+ Name: langvision
3
+ Version: 0.1.0
4
+ Summary: Efficient LoRA Fine-Tuning for Vision LLMs with advanced CLI and model zoo
5
+ Home-page: https://github.com/langtrain-ai/langtrain
6
+ Author: Pritesh Raj
7
+ Author-email: priteshraj10@gmail.com
8
+ Keywords: vision,transformer,lora,fine-tuning,deep-learning,computer-vision
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.8
22
+ Requires-Dist: torch>=1.10.0
23
+ Requires-Dist: torchvision>=0.11.0
24
+ Requires-Dist: numpy>=1.21.0
25
+ Requires-Dist: pillow>=8.3.0
26
+ Requires-Dist: tqdm>=4.62.0
27
+ Requires-Dist: pyyaml>=6.0
28
+ Requires-Dist: tensorboard>=2.9.0
29
+ Requires-Dist: wandb>=0.13.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
32
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
33
+ Requires-Dist: pytest-mock>=3.8.0; extra == "dev"
34
+ Requires-Dist: black>=22.0.0; extra == "dev"
35
+ Requires-Dist: isort>=5.10.0; extra == "dev"
36
+ Requires-Dist: flake8>=5.0.0; extra == "dev"
37
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
38
+ Requires-Dist: pre-commit>=2.20.0; extra == "dev"
39
+ Requires-Dist: bandit>=1.7.0; extra == "dev"
40
+ Provides-Extra: docs
41
+ Requires-Dist: sphinx>=5.0.0; extra == "docs"
42
+ Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
43
+ Requires-Dist: myst-parser>=0.18.0; extra == "docs"
44
+ Requires-Dist: sphinx-autodoc-typehints>=1.19.0; extra == "docs"
45
+ Provides-Extra: examples
46
+ Requires-Dist: jupyter>=1.0.0; extra == "examples"
47
+ Requires-Dist: ipywidgets>=7.6.0; extra == "examples"
48
+ Requires-Dist: tensorboard>=2.9.0; extra == "examples"
49
+ Requires-Dist: wandb>=0.13.0; extra == "examples"
@@ -1,46 +1,4 @@
1
- Metadata-Version: 2.4
2
- Name: langvision
3
- Version: 0.0.2
4
- Summary: A package for finetuning vision models.
5
- Author-email: Pritesh Raj <priteshraj10@gmail.com>
6
- License: MIT License
7
-
8
- Copyright (c) 2025 Plim
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
- Project-URL: Homepage, https://github.com/langtrain-ai/langtrain
28
- Project-URL: Documentation, https://github.com/langtrain-ai/langtrain/tree/main/docs
29
- Project-URL: Source, https://github.com/langtrain-ai/langtrain
30
- Project-URL: Tracker, https://github.com/langtrain-ai/langtrain/issues
31
- Requires-Python: >=3.8
32
- Description-Content-Type: text/markdown
33
- License-File: LICENSE
34
- Requires-Dist: torch>=1.10
35
- Requires-Dist: numpy
36
- Requires-Dist: tqdm
37
- Requires-Dist: pyyaml
38
- Requires-Dist: scipy
39
- Requires-Dist: matplotlib
40
- Requires-Dist: pillow
41
- Dynamic: license-file
42
-
43
- # Langvision: Vision LLMs with Efficient LoRA Fine-Tuning
1
+ # Langvision: Efficient LoRA Fine-Tuning for Vision LLMs
44
2
 
45
3
  <hr/>
46
4
  <p align="center">
@@ -60,11 +18,46 @@ Dynamic: license-file
60
18
  <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"></a>
61
19
  </p>
62
20
 
63
- <p align="center">
64
- <b>Langvision provides modular components for vision models and LoRA-based fine-tuning.</b><br/>
65
- <span style="font-size:1.1em"><i>Adapt and fine-tune vision models for a range of tasks.</i></span>
66
- </p>
67
- <hr/>
21
+ ---
22
+
23
+ ## 🚀 Installation
24
+
25
+ > **Requirements:**
26
+ > - Python 3.8 or newer
27
+ > - [PyTorch](https://pytorch.org/get-started/locally/) (CPU or GPU)
28
+
29
+ **Install the latest release from PyPI:**
30
+
31
+ ```bash
32
+ pip install langvision
33
+ ```
34
+
35
+ [![PyPI version](https://img.shields.io/pypi/v/langvision.svg?label=View%20on%20PyPI)](https://pypi.org/project/langvision/)
36
+
37
+ **Optional installs:**
38
+
39
+ - For development:
40
+ ```bash
41
+ pip install langvision[dev]
42
+ ```
43
+ - For documentation:
44
+ ```bash
45
+ pip install langvision[docs]
46
+ ```
47
+ - For examples and notebooks:
48
+ ```bash
49
+ pip install langvision[examples]
50
+ ```
51
+ - For GPU (CUDA 11.3+):
52
+ ```bash
53
+ pip install langvision[gpu]
54
+ ```
55
+
56
+ **Troubleshooting:**
57
+ - For GPU support, ensure you have the correct CUDA version and install PyTorch as per [official instructions](https://pytorch.org/get-started/locally/).
58
+ - If you encounter issues, see [Troubleshooting](docs/troubleshooting.md) or [open an issue](https://github.com/langtrain-ai/langtrain/issues).
59
+
60
+ ---
68
61
 
69
62
  ## Quick Links
70
63
  - [Documentation](docs/index.md)
@@ -90,41 +83,86 @@ Dynamic: license-file
90
83
  - [Examples & Use Cases](#examples--use-cases)
91
84
  - [Extending the Framework](#extending-the-framework)
92
85
  - [Contributing](#contributing)
93
- - [FAQ](#faq)
86
+ - [License](#license)
94
87
  - [Citation](#citation)
95
88
  - [Acknowledgements](#acknowledgements)
96
- - [License](#license)
89
+ - [Advanced LLM Concepts](#advanced-llm-concepts)
97
90
 
98
91
  ---
99
92
 
100
93
  ## Features
101
- - LoRA adapters for parameter-efficient fine-tuning
94
+ - LoRA adapters for efficient fine-tuning
102
95
  - Modular Vision Transformer (ViT) backbone
103
- - Model zoo for open-source visual models
96
+ - Model zoo for vision models
104
97
  - Configurable and extensible codebase
105
- - Checkpointing and resume support
98
+ - Checkpointing and resume
106
99
  - Mixed precision and distributed training
107
- - Built-in metrics and visualization tools
108
- - CLI for fine-tuning and evaluation
109
- - Extensible callbacks (early stopping, logging, etc.)
100
+ - Metrics and visualization tools
101
+ - CLI for training and evaluation
102
+ - Callback support (early stopping, logging, etc.)
110
103
 
111
104
  ---
112
105
 
113
106
  ## Showcase
114
107
 
115
- Langvision is a framework for building and fine-tuning vision models with LoRA support. It is suitable for tasks such as image classification, visual question answering, and custom vision applications.
108
+ Langvision is intended for building and fine-tuning vision models with LoRA. It can be used for image classification, visual question answering, and other computer vision tasks.
116
109
 
117
110
  ---
118
111
 
119
112
  ## Getting Started
120
113
 
121
- Install with pip:
114
+ Install:
122
115
 
123
116
  ```bash
124
117
  pip install langvision
125
118
  ```
126
119
 
127
- Minimal example:
120
+ ### CLI Usage
121
+
122
+ After installation, you can use the comprehensive CLI:
123
+
124
+ ```bash
125
+ # Show all available commands
126
+ langvision --help
127
+
128
+ # Training commands
129
+ langvision train --help
130
+ langvision finetune --help
131
+
132
+ # Model management
133
+ langvision evaluate --help
134
+ langvision export --help
135
+ langvision model-zoo --help
136
+ langvision config --help
137
+ ```
138
+
139
+ **Quick Examples:**
140
+
141
+ ```bash
142
+ # Train a model
143
+ langvision train --dataset cifar10 --epochs 5 --batch_size 32
144
+
145
+ # Fine-tune with advanced features
146
+ langvision finetune --dataset cifar100 --epochs 10 --lora_r 8 --rlhf
147
+
148
+ # Evaluate a trained model
149
+ langvision evaluate --checkpoint model.pth --dataset cifar10
150
+
151
+ # Export to ONNX
152
+ langvision export --checkpoint model.pth --format onnx --output model.onnx
153
+
154
+ # Browse model zoo
155
+ langvision model-zoo list
156
+ langvision model-zoo download vit_base_patch16_224
157
+
158
+ # Create configuration
159
+ langvision config create --template advanced --output my_config.yaml
160
+
161
+ # Check version
162
+ langvision --version
163
+ ```
164
+
165
+ Example usage:
128
166
 
129
167
  ```python
130
168
  import torch
@@ -149,28 +187,28 @@ with torch.no_grad():
149
187
  print('Output shape:', out.shape)
150
188
  ```
151
189
 
152
- For more details, see the [Documentation](docs/index.md) and [src/langvision/cli/finetune.py](src/langvision/cli/finetune.py).
190
+ See the [Documentation](docs/index.md) and [src/langvision/cli/finetune.py](src/langvision/cli/finetune.py) for more details.
153
191
 
154
192
  ---
155
193
 
156
194
  ## Supported Python Versions
157
- - Python 3.8+
195
+ - Python 3.8 or newer
158
196
 
159
197
  ---
160
198
 
161
199
  ## Why langvision?
162
200
 
163
- - Parameter-efficient fine-tuning with LoRA adapters
164
- - Modular ViT backbone for flexible model design
165
- - Unified interface for open-source vision models
166
- - Designed for both research and production
167
- - Efficient memory usage for large models
201
+ - Fine-tuning with LoRA adapters
202
+ - Modular ViT backbone design
203
+ - Unified interface for vision models
204
+ - Suitable for research and production
205
+ - Efficient memory usage
168
206
 
169
207
  ---
170
208
 
171
209
  ## Architecture Overview
172
210
 
173
- Langvision uses a modular Vision Transformer backbone with LoRA adapters in attention and MLP layers. This allows adaptation of pre-trained models with fewer trainable parameters.
211
+ Langvision uses a Vision Transformer backbone with LoRA adapters in attention and MLP layers. This enables adaptation of pre-trained models with fewer trainable parameters.
174
212
 
175
213
  ### Model Data Flow
176
214
 
@@ -269,7 +307,7 @@ lora:
269
307
  ---
270
308
 
271
309
  ## Documentation & Resources
272
- - [API Reference](docs/api/index.md)
310
+ - [API Reference](docs/index.md)
273
311
  - [Tutorials and Examples](docs/tutorials/index.md)
274
312
  - [Research Papers](#research-papers)
275
313
  - [Best Practices Guide](docs/best_practices.md)
@@ -340,12 +378,14 @@ model.finetune(dataset, config_path="configs/custom_config.yaml")
340
378
  - For advanced usage, see `src/langvision/cli/finetune.py`.
341
379
 
342
380
  ## Contributing
343
- We welcome contributions. See the [Contributing Guide](CONTRIBUTING.md) for details.
381
+ Contributions are welcome. See the [Contributing Guide](CONTRIBUTING.md) for details.
344
382
 
345
- ## License & Citation
383
+ ## License
346
384
 
347
385
  This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
348
386
 
387
+ ## Citation
388
+
349
389
  If you use langvision in your research, please cite:
350
390
 
351
391
  ```bibtex
@@ -370,3 +410,19 @@ We thank the following projects and communities:
370
410
  <b>Made in India 🇮🇳 with ❤️ by the langtrain team</b><br/>
371
411
  <i>Star ⭐ this repo if you find it useful!</i>
372
412
  </p>
413
+
414
+ ## Advanced LLM Concepts
415
+
416
+ This library is designed to be extensible with advanced concepts in large language models (LLMs) and explainable AI, including:
417
+
418
+ - **RLHF**: Reinforcement Learning from Human Feedback
419
+ - **CoT**: Chain-of-Thought
420
+ - **CCoT**: Contrastive Chain-of-Thought
421
+ - **GRPO**: Generalized Reinforcement Policy Optimization
422
+ - **RLVR**: Reinforcement Learning with Value Ranking
423
+ - **DPO**: Direct Preference Optimization
424
+ - **PPO**: Proximal Policy Optimization
425
+ - **LIME**: Local Interpretable Model-agnostic Explanations
426
+ - **SHAP**: SHapley Additive exPlanations
427
+
428
+ See the [`src/langvision/concepts/`](src/langvision/concepts/) directory for modularized explanations and stubs for each concept. These serve as a foundation for future development and integration into the library's training and evaluation workflows.
@@ -0,0 +1,11 @@
1
+ remote_theme: pages-themes/cayman@v0.2.0
2
+ plugins:
3
+ - jekyll-remote-theme
4
+
5
+ title: Langvision
6
+ description: Efficient Vision LLMs with LoRA Fine-Tuning
7
+ show_downloads: true
8
+ github:
9
+ repository_url: https://github.com/langtrain-ai/langvision
10
+ zip_url: https://github.com/langtrain-ai/langvision/zipball/main
11
+ tar_url: https://github.com/langtrain-ai/langvision/tarball/main
@@ -0,0 +1,34 @@
1
+ # Core dependencies
2
+ torch>=1.10.0
3
+ torchvision>=0.11.0
4
+ numpy>=1.21.0
5
+ tqdm>=4.62.0
6
+ pyyaml>=6.0
7
+ scipy>=1.7.0
8
+ matplotlib>=3.5.0
9
+ pillow>=8.3.0
10
+ timm>=0.6.0
11
+ transformers>=4.20.0
12
+
13
+ # Development dependencies (install with: pip install -r requirements-dev.txt)
14
+ # pytest>=7.0.0
15
+ # pytest-cov>=4.0.0
16
+ # pytest-mock>=3.8.0
17
+ # black>=22.0.0
18
+ # isort>=5.10.0
19
+ # flake8>=5.0.0
20
+ # mypy>=1.0.0
21
+ # pre-commit>=2.20.0
22
+ # bandit>=1.7.0
23
+
24
+ # Documentation dependencies (install with: pip install -r requirements-docs.txt)
25
+ # sphinx>=5.0.0
26
+ # sphinx-rtd-theme>=1.0.0
27
+ # myst-parser>=0.18.0
28
+ # sphinx-autodoc-typehints>=1.19.0
29
+
30
+ # Example dependencies (install with: pip install -r requirements-examples.txt)
31
+ # jupyter>=1.0.0
32
+ # ipywidgets>=7.6.0
33
+ # tensorboard>=2.9.0
34
+ # wandb>=0.13.0
@@ -0,0 +1,70 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="langvision",
5
+ version="0.1.0",
6
+ description="Efficient LoRA Fine-Tuning for Vision LLMs with advanced CLI and model zoo",
7
+ author="Pritesh Raj",
8
+ author_email="priteshraj10@gmail.com",
9
+ url="https://github.com/langtrain-ai/langtrain",
10
+ packages=find_packages(where="src"),
11
+ package_dir={"": "src"},
12
+ python_requires=">=3.8",
13
+ install_requires=[
14
+ "torch>=1.10.0",
15
+ "torchvision>=0.11.0",
16
+ "numpy>=1.21.0",
17
+ "pillow>=8.3.0",
18
+ "tqdm>=4.62.0",
19
+ "pyyaml>=6.0",
20
+ "tensorboard>=2.9.0",
21
+ "wandb>=0.13.0",
22
+ ],
23
+ extras_require={
24
+ "dev": [
25
+ "pytest>=7.0.0",
26
+ "pytest-cov>=4.0.0",
27
+ "pytest-mock>=3.8.0",
28
+ "black>=22.0.0",
29
+ "isort>=5.10.0",
30
+ "flake8>=5.0.0",
31
+ "mypy>=1.0.0",
32
+ "pre-commit>=2.20.0",
33
+ "bandit>=1.7.0",
34
+ ],
35
+ "docs": [
36
+ "sphinx>=5.0.0",
37
+ "sphinx-rtd-theme>=1.0.0",
38
+ "myst-parser>=0.18.0",
39
+ "sphinx-autodoc-typehints>=1.19.0",
40
+ ],
41
+ "examples": [
42
+ "jupyter>=1.0.0",
43
+ "ipywidgets>=7.6.0",
44
+ "tensorboard>=2.9.0",
45
+ "wandb>=0.13.0",
46
+ ],
47
+ },
48
+ entry_points={
49
+ "console_scripts": [
50
+ "langvision=langvision.cli:main",
51
+ ],
52
+ },
53
+ classifiers=[
54
+ "Development Status :: 4 - Beta",
55
+ "Intended Audience :: Developers",
56
+ "Intended Audience :: Science/Research",
57
+ "Operating System :: OS Independent",
58
+ "Programming Language :: Python :: 3",
59
+ "Programming Language :: Python :: 3.8",
60
+ "Programming Language :: Python :: 3.9",
61
+ "Programming Language :: Python :: 3.10",
62
+ "Programming Language :: Python :: 3.11",
63
+ "Programming Language :: Python :: 3.12",
64
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
65
+ "Topic :: Software Development :: Libraries :: Python Modules",
66
+ ],
67
+ keywords=["vision", "transformer", "lora", "fine-tuning", "deep-learning", "computer-vision"],
68
+ include_package_data=True,
69
+ zip_safe=False,
70
+ )
@@ -0,0 +1,82 @@
1
+ """
2
+ langvision - Modular Vision LLMs with Efficient LoRA Fine-Tuning
3
+
4
+ A research-friendly framework for building and fine-tuning Vision Large Language Models
5
+ with efficient Low-Rank Adaptation (LoRA) support.
6
+ """
7
+
8
+ __version__ = "0.1.0"
9
+ __author__ = "Pritesh Raj"
10
+ __email__ = "priteshraj10@gmail.com"
11
+
12
+ # Core imports for easy access
13
+ from .models.vision_transformer import VisionTransformer
14
+ from .models.lora import LoRALinear, LoRAConfig, AdaLoRALinear, QLoRALinear
15
+ from .models.resnet import resnet18, resnet34, resnet50, resnet101, resnet152
16
+ from .models.multimodal import VisionLanguageModel, create_multimodal_model, CLIPLoss
17
+ from .utils.config import default_config
18
+ from .training.trainer import Trainer
19
+ from .training.advanced_trainer import AdvancedTrainer, TrainingConfig
20
+ from .data.datasets import get_dataset
21
+ from .data.enhanced_datasets import (
22
+ EnhancedImageDataset, MultimodalDataset, DatasetConfig,
23
+ create_enhanced_dataloaders, SmartAugmentation
24
+ )
25
+ from .utils.metrics import (
26
+ MetricsTracker, ClassificationMetrics, ContrastiveMetrics,
27
+ EvaluationSuite, PerformanceMetrics
28
+ )
29
+ from .callbacks.base import Callback, CallbackManager
30
+ from .concepts import RLHF, CoT, CCoT, GRPO, RLVR, DPO, PPO, LIME, SHAP
31
+
32
+ # Version info
33
+ __all__ = [
34
+ "__version__",
35
+ "__author__",
36
+ "__email__",
37
+ # Core Models
38
+ "VisionTransformer",
39
+ "resnet18", "resnet34", "resnet50", "resnet101", "resnet152",
40
+ "VisionLanguageModel", "create_multimodal_model",
41
+ # LoRA Components
42
+ "LoRALinear", "LoRAConfig", "AdaLoRALinear", "QLoRALinear",
43
+ # Training
44
+ "Trainer", "AdvancedTrainer", "TrainingConfig",
45
+ # Data
46
+ "get_dataset", "EnhancedImageDataset", "MultimodalDataset",
47
+ "DatasetConfig", "create_enhanced_dataloaders", "SmartAugmentation",
48
+ # Utilities
49
+ "default_config", "MetricsTracker", "ClassificationMetrics",
50
+ "ContrastiveMetrics", "EvaluationSuite", "PerformanceMetrics",
51
+ # Callbacks
52
+ "Callback", "CallbackManager",
53
+ # Loss Functions
54
+ "CLIPLoss",
55
+ # Concepts
56
+ "RLHF", "CoT", "CCoT", "GRPO", "RLVR", "DPO", "PPO", "LIME", "SHAP",
57
+ ]
58
+
59
+ # Optional imports for advanced usage
60
+ try:
61
+ from .callbacks import EarlyStoppingCallback, LoggingCallback
62
+ from .utils.device import get_device, to_device
63
+ __all__.extend([
64
+ "EarlyStoppingCallback",
65
+ "LoggingCallback",
66
+ "get_device",
67
+ "to_device"
68
+ ])
69
+ except ImportError:
70
+ pass
71
+
72
+ # Package metadata
73
+ PACKAGE_METADATA = {
74
+ "name": "langvision",
75
+ "version": __version__,
76
+ "description": "Modular Vision LLMs with Efficient LoRA Fine-Tuning",
77
+ "author": __author__,
78
+ "email": __email__,
79
+ "url": "https://github.com/langtrain-ai/langtrain",
80
+ "license": "MIT",
81
+ "python_requires": ">=3.8",
82
+ }