Skip to main content

Multi-Modality

GPT4

The open source implementation of the base model behind GPT-4 from OPENAI [Language + Multi-Modal], click here for the Research Paper

Installation

pip install gpt4-torch

Usage

Here's an illustrative code snippet that showcases GPT-3 in action:

import torch
from gpt4 import GPT4

# Generate a random input sequence
x = torch.randint(0, 256, (1, 1024)).cuda()

# Initialize GPT-3 model
model = GPT4()

# Pass the input sequence through the model
output = model(x)

MultiModal Iteration

  • Pass in text and and image tensors into GPT4
import torch
from gpt4.gpt4 import GPT4MultiModal

#usage
img = torch.randn(1, 3, 256, 256)
text = torch.randint(0, 20000, (1, 1024))


model = GPT4MultiModal()
output = model(text, img)

📚 Training

from gpt4 import train

train()

For further instructions, refer to the Training SOP.

  1. Set the environment variables:

    • ENTITY_NAME: Your wandb project name
    • OUTPUT_DIR: Directory to save the weights (e.g., ./weights)
    • MASTER_ADDR: For distributed training
    • MASTER_PORT For master port distributed training
    • RANK- Number of nodes services
    • WORLD_SIZE Number of gpus
  2. Configure the training:

    • Accelerate Config
    • Enable Deepspeed 3
    • Accelerate launch train_distributed_accelerate.py

For more information, refer to the Training SOP.

Metadata

Release files for gpt4-torch 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpt4-torch 0.0.3
File Size Uploaded
gpt4_torch-0.0.3.tar.gz 28.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpt4-torch 0.0.3
File Interpreter ABI Platform
gpt4_torch-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 56.9 kB

Release files / gpt4_torch-0.0.3.tar.gz

Download URL gpt4_torch-0.0.3.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
04801544de0ad4c9a2a1b8b91d07b9f363774077921a2df48dfaad9fecc8ea5a
BLAKE2b-256 checksum
How to use checksums
ac00bd320b816761bdd79d7170151b4e04a1224e893550c632761c0b3c743bad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

Release files / gpt4_torch-0.0.3-py3-none-any.whl

Download URL gpt4_torch-0.0.3-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce7dec810c55b4022634ca276e7f5a82939b845e57287e508b23bdb6fb533d39
BLAKE2b-256 checksum
How to use checksums
6eb3b670acb4b361f07ff2756939d3676db22d2d42ce2883a45ce0cd3dbd2586
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page