Skip to main content

Package to display a progress bar for long processes with uncertain end times

Project description

LoadTime

English | 日本語

LoadTime is a Python package designed specifically to tackle the challenge of long waiting times associated with loading large-scale pretrained language models, such as HuggingFace models, into GPU or CPU memory.

With LoadTime, instead of waiting in uncertainty, you can visualize the progress of your loading process.

Of course, it can also be used for other long-term operations.

Installation

You can install LoadTime via pip:

pip install loadtime

Key Features

  • Real-time tracking: LoadTime provides real-time tracking of the loading process. No more staring at a static screen!

  • Progress Bar: The package displays a progress bar, showing you how much of the process has been completed and how much is still remaining. It takes the guesswork out of waiting!

  • Past Loading Time Cache: One unique feature of LoadTime is its ability to remember the time it took to load a model in the past. The package automatically caches the total loading time of your operations. The next time you load the same model, LoadTime uses this cached information to provide an even more accurate progress bar.

  • Customizable Display: LoadTime allows you to customize the progress display with your own messages. You can tailor the tool to fit your personal needs.

  • Optimized for HuggingFace Models: LoadTime has been optimized for loading HuggingFace models, with special handling of the download progress display when the model is not cached locally.

Basic Usage

Here is a simple example of how to use the LoadTime package:

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from loadtime import LoadTime

model_path = "togethercomputer/RedPajama-INCITE-Chat-3B-v1"

tokenizer = AutoTokenizer.from_pretrained(model_path)
model = LoadTime(name=model_path,
                 fn=lambda: AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.float16))()

Initial Parameters

| Parameter | Description | |-----------|-------------| | name | Name of the long-term process. For loading HuggingFace models, specify the model name. | | message | Specify the message to be displayed. If omitted, the default message is used. | | pbar | Set to True to display the progress bar and percentage. | | dirname | Directory name for cache storage. | | hf | Set to True to use for time display for loading HuggingFace models. If the model data has not yet been downloaded to the disk, HuggingFace's loader displays the download progress, so this library does not display it. | | fn | Function to execute the long-term process. | | fn_print | Function to perform the display. If omitted, it will be output to the console. |

Take control of your loading times with LoadTime!

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

loadtime-1.0.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

loadtime-1.0.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file loadtime-1.0.0.tar.gz.

File metadata

  • Download URL: loadtime-1.0.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for loadtime-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a4057815ec04ad29d4773720a27bb26d2e7e5c908cae8da297162f4bf1ba5807
MD5 230057a4d8a714ed78b7039505b2d29f
BLAKE2b-256 b63a98b323e40ac5651b0c7a1d14155599bab6b0c3fbaa2479c27c8b3c8a94f5

See more details on using hashes here.

File details

Details for the file loadtime-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: loadtime-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for loadtime-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9eae5d7489f1a9010f27259d43d77de940a3f7f5c2fe45a5c61d695a229a8ce7
MD5 89417b68fb3d0305b4f062c198536db7
BLAKE2b-256 0ecbcd760a243094693ecc5096fe139038a933ae867e58d55556b52d51d1b55f

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