GPT4 - Pytorch
Project description
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.
-
Set the environment variables:
ENTITY_NAME
: Your wandb project nameOUTPUT_DIR
: Directory to save the weights (e.g.,./weights
)MASTER_ADDR
: For distributed trainingMASTER_PORT
For master port distributed trainingRANK
- Number of nodes servicesWORLD_SIZE
Number of gpus
-
Configure the training:
- Accelerate Config
- Enable Deepspeed 3
- Accelerate launch train_distributed_accelerate.py
For more information, refer to the Training SOP.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gpt4_torch-0.0.3.tar.gz
(28.8 kB
view details)
Built Distribution
File details
Details for the file gpt4_torch-0.0.3.tar.gz
.
File metadata
- Download URL: gpt4_torch-0.0.3.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04801544de0ad4c9a2a1b8b91d07b9f363774077921a2df48dfaad9fecc8ea5a |
|
MD5 | 3466f84d98ffe8327c03339e3f2aae69 |
|
BLAKE2b-256 | ac00bd320b816761bdd79d7170151b4e04a1224e893550c632761c0b3c743bad |
File details
Details for the file gpt4_torch-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: gpt4_torch-0.0.3-py3-none-any.whl
- Upload date:
- Size: 28.1 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce7dec810c55b4022634ca276e7f5a82939b845e57287e508b23bdb6fb533d39 |
|
MD5 | c215fe941a9acdd2486d4f8523fd0315 |
|
BLAKE2b-256 | 6eb3b670acb4b361f07ff2756939d3676db22d2d42ce2883a45ce0cd3dbd2586 |