Skip to main content

An educational module for experimenting with unsupervised learning in large language modeling

Reason this release was yanked:

error in homepage URL

Project description

Consult the module API page at

https://engineering.purdue.edu/kak/distGPT/babyGPT-1.0.4.html

for all information related to this module, including information related to the latest changes to the code. The page at the URL shown above lists all of the module functionality you can invoke in your own code.

Creating an instance of babyGPT:

        baby_gpt = babyGPT(
                            max_seq_length = max_seq_length,
                            batch_size = batch_size,
                            embedding_size = embedding_size,
                            num_basic_decoders = num_basic_decoders,
                            num_atten_heads = num_atten_heads,
                            optimizer_params = optimizer_params,
                            num_warmup_steps = num_warmup_steps,
                            masking = masking,
                            verify_text_corpus = False,
                            path_saved_model = {"decoder" : "./saved_decoder",
                                                "embedding_generator" : "./saved_embedding_generator",
                                               },
                          )

Since babyGPT calls on TransformerFG for language modeling, you must also construct an instance of that class:

        xformer = baby_gpt.TransformerFG(
                            max_seq_length = max_seq_length,
                            embedding_size = embedding_size,
                            tokenizer_json = tokenizer_json,
                            num_warmup_steps = num_warmup_steps,
                            optimizer_params = optimizer_params,
                  )

Withing the TransformerFG module, it is the MasterDecoder class that is needed for the next word prediction for the purpose of self-supervised learning:

        master_decoder = baby_gpt.MasterDecoderWithMasking(
                            xformer,
                            num_basic_decoders = num_basic_decoders,
                            num_atten_heads = num_atten_heads,
                            masking = masking
                         )


Finally, here is an instance of the dataloader you're going to need:

        dataloader = baby_gpt.ArticleDatasetWithBufferedContext(
                            gpt = baby_gpt,
                            tokenizer_json = tokenizer_json,
                            context_window_size = context_window_size,
                            context_buffer_size = context_buffer_size,
                            articles_dir = articles_dir,
                     )

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

babyGPT-1.0.4.tar.gz (632.7 kB view details)

Uploaded Source

File details

Details for the file babyGPT-1.0.4.tar.gz.

File metadata

  • Download URL: babyGPT-1.0.4.tar.gz
  • Upload date:
  • Size: 632.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for babyGPT-1.0.4.tar.gz
Algorithm Hash digest
SHA256 0c339d504714dee7d384073582f5635c8a23b87bef8f5c77524b9409419ffb22
MD5 d0b7703ff9edd90c8f4e7bbbb7c8ab46
BLAKE2b-256 5b2cbd5fb436984012c9f5c68edb13658fe2fa69a10873e5ddd0a68254911dbf

See more details on using hashes here.

Supported by

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