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_PORTFor master port distributed trainingRANK- Number of nodes servicesWORLD_SIZENumber of gpus
-
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)
| File | Size | Uploaded | |
|---|---|---|---|
| gpt4_torch-0.0.3.tar.gz | 28.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|