Skip to main content

qformer - Pytorch

Project description

Multi-Modality

Qformer

Implementation of Qformer from BLIP2 in Zeta Lego blocks. The implementation is here straight from Figure 2. In particular the image block and text block.

Install

pip3 install qformer

Usage

import torch
from qformer import QFormer

x = torch.randn(
    1, 32, 512
)  # Create a random tensor of shape (1, 32, 512)

img = torch.randn(
    1, 32, 512
)  # Create another random tensor of shape (1, 32, 512)

qformer = QFormer(
    512, 8, 8, 0.1, 2, 2
)  # Create an instance of the QFormer model

y = qformer(
    x, img
)  # Apply the QFormer model to the input tensors x and img

print(y.shape)  # Print the shape of the output tensor y

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qformer-0.0.4.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

qformer-0.0.4-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file qformer-0.0.4.tar.gz.

File metadata

  • Download URL: qformer-0.0.4.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

File hashes

Hashes for qformer-0.0.4.tar.gz
Algorithm Hash digest
SHA256 168e380f9279098bccf69d62407369583d83bd9ddbd55d919fbd5d94d870906e
MD5 1c05104ecaff450dcd2c9f1648d6e03c
BLAKE2b-256 b8bd4248b918169b264a61cbbd32a63c7571de2437722f5bdf66365f8ab672fb

See more details on using hashes here.

File details

Details for the file qformer-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: qformer-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

File hashes

Hashes for qformer-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 743dacaefc8607a8080a3d88fd70e01c2c59174427b1cf3a8d013d1dbeecfb0d
MD5 b52509ebc7a57d4209719a287532abb7
BLAKE2b-256 bf2e3a41895f0dcf60c04f3d9a6416e3f59981b7425d2f5719efda4ea3a3515f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page