semvec/pypi-packages huggingface dataset:
pyproject-pyupgrade 0.1.1
Pyupgrade wrapper to supply configuration via pyproject.toml
License: MIT
Requires Python: >=3.7,<4.0

# pyproject pyupgrade

pyproject.toml configuration wrapper for [pyupgrade](https://github.com/asottile/pyupgrade)

## Installation

Via pip

```shell
pip install pyproject-pyupgrade
```

Via poetry

```shell
poetry add --group dev pyproject-pyupgrade
```

Via pipx

```shell
pipx install -f pyproject-pyupgrade
```

## Usage

Make sure you have a desired version of `pyupgrade`
installed in your python environment.

Add the following section in your `pyproject.toml`:

```toml
[tool.pyupgrade]
# for example, if you're using python 3.10
py310-plus = true
```

And then just execute it via CLI

```shell
pyproject-pyupgrade [filename [filenames...]]
```

or shorter version

```shell
ppyupgrade [filename [filenames...]]
```

So, basically you specify flags that you want to add to `pyupgrade`
CLI arguments specifying them without leading two dashes (`--`).
This is the way how you can supply any option that your version of `pyupgrade` receives

There is also one additional parameter provided exclusively by `pyproject-pyupgrade` wrapper:

```toml
[tool.pyupgrade]
pyproject-pyupgrade-debug = true
```

Or directly via CLI

```shell
ppyupgrade --pyproject-pyupgrade-debug ...
```

This option is going to output debug information about `pyproject-pyupgrade`.
Info about parsed configuration from pyproject.toml (if there is one) and all the flags

## As a pre-commit hook

See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions.

Sample `.pre-commit-config.yaml`:

```yaml
repos:
  - repo: https://github.com/venomlab/pyproject-pyupgrade
    rev: v0.1.1
    hooks:
      - id: ppyupgrade
```

## ToDo

- [ ] Add tests and `tox` config to run them for all supported python versions
- [ ] Add option to specify custom `pyupgrade` command. It allows in case if you want to chain pyupgrade wrappers (for instance, with [pyupgrade-directories](https://github.com/domdfcoding/pyupgrade-directories))
- [ ] Add better parser for TOML. Right now the parser is ultra primitive and might lead to errors if used improperly
- [ ] If `python` version >= `3.11` use tomllib for `pyproject.toml` parsing
- [ ] Support adding custom options or key-value arguments to `pyupgrade` CLI
- [ ] Support storing configuration in `pyupgrade.ini`
- [ ] Support storing configuration in `tox.ini`
- [ ] Support storing configuration in `setup.cfg`
palm-vadapter 0.0.1
Paper - Pytorch
License: MIT
Requires Python: >=3.6,<4.0
Keywords: artificial intelligence,deep learning,optimizers,Prompt Engineering

[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)

# Palm2 Adapter
Implementation of "PaLM2-VAdapter:" from the multi-modal model paper: "PaLM2-VAdapter: Progressively Aligned Language Model Makes a Strong Vision-language Adapter".

This model uses a perceiver resampler with a depth of 1 + a tiny palm to efficiently learn the features behind the images and then map them  to the same space as the big model.

## install
`$ pip install palm2-vadapter`


## usage
```python
import torch
from palm_vadapter.main import PaLM2VAdapter

# Random text and image tensors
text = torch.randint(0, 1000, (1, 32), dtype=torch.long)


# Image tensor
img = torch.randn(1, 3, 224, 224)

# Initialize PaLM2VAdapter model
model = PaLM2VAdapter(
    tiny_dim=512,
    dim=512,
    num_tokens=10000,
    seq_length=32,
    depth=6,
    heads=8,
    image_size=224,
    patch_size=16,
)

# Forward pass through the model
out = model(text, img)

# Print the shape of the output
print(out.shape)
```


# License
MIT

## Citation
```bibtex
@misc{xiao2024palm2vadapter,
    title={PaLM2-VAdapter: Progressively Aligned Language Model Makes a Strong Vision-language Adapter}, 
    author={Junfei Xiao and Zheng Xu and Alan Yuille and Shen Yan and Boyu Wang},
    year={2024},
    eprint={2402.10896},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}
```