Skip to main content

A package containing the logger demo for Software Hut using Hugging Face 🤗 Transformers Trainer.

Project description

Software Hut Logger

A package containing the logger demo for Software Hut using Hugging Face 🤗 Transformers Trainer.

Important Notes:

  • If you find anything is broken or confusing, please open an issue so that all teams can benefit from any explanations and fixes.
  • This module was developed on linux and is untested on Windows. I would recommend using WSL2 if you don't have a linux machine available but Windows might work. I won't be able to support Windows specific issues.
  • You won't need to run the training script but if you really want to, linux/WSL2 and CUDA>=12.1 on an NVIDIA GPU are required.

Index

TODO

  • Finish documentation
  • Add system monitoring
  • Fix run-dir argument not being passed to logger
  • Add more comprehensive log example from long training run
  • Add project, experiment and run name to metadata file

1. Installation & Setup

# Create a virtual environment
python3 -m venv shl-demo-venv
source shl-demo-venv/bin/activate
pip install software-hut-logger

NOTE: If you want to edit the code or rerun the training script for any reason, let me know and I'll add instructions.

2. Usage

If installed correctly, the package should be available as a command-line tool.

# Both commands are equivalent
shl <command> [ --project-name <project-name> ] [ --experiment-name <experiment-name> ] [ --run-name <run-name> ] [...command-specific-options]

software-hut-logger <command> [ --project-name <project-name> ] [ --experiment-name <experiment-name> ] [ --run-name <run-name> ] [...command-specific-options]

NOTE: Anywhere that "-" is used in an argument name, "_" is also valid.

EXPAND: What the hell is this command description syntax?

Backus-Naur-Form-style (BNF-style) command description syntax

Command Description
<command> Required argument
[ --optional-args ] Optional arguments
| Logical OR (mutually exclusive)

Examples:

# argument1 is required
<argument1>

# One of argument1 or argument2 must be specified
<argument1 | argument2>

# argument1 is optional
[argument1]

# argument1 is required and argument2 is optional
<argument2> [argument1]

# If argument1 is specified, then argument2 is required
[argument1 <argument2>]

2.1 Commands

There are three commands you can use but only two that you'll probably need to use.

2.1.1 start-server

Starts a mock endpoint for you to explore uploading runs to. It is currently implemented with an API key -- if you chose to implement authentication in a different way, let me know and I'll add support for that.

shl server <start [--upload-url <upload-url>] [--upload-port <upload-port>] [-q | --quiet] [--api-key <api-key>] [--workers <num-workers>] | stop [--pid-file <pid-file>]>  

Minimal Example:

# Starts the demo-server at http://0.0.0.0:8000
shl server start

# Stops the demo-server -- only needed if you started the server with the `-q` flag
shl server stop
EXPAND: Argument Descriptions
Argument Description Default
--start Starts the demo-server. false
--stop Stop the demo-server. false
--upload-url URL or IP address of receiving server 0.0.0.0
--upload-port Port number of receiving server 8000
-q | --quiet Launch server in background and exit false
--workers Number of worker processes 1
--pid-file File to store the process ID uvicorn.pid
--api-key API key for authentication super-secret-api-key

2.1.2 upload-run

Uploads a log file to the specified endpoint.

shl upload-run [--run-dir <run-dir>] [--api-key <api-key>] [--upload-url <upload-url>] [--upload-port <upload-port>]

Minimal Example:

# Uploads example_log to the demo-server at http://0.0.0.0:8000
shl upload-run
EXPAND: Argument Descriptions
Argument Description Default
--run-dir Path to run directory example_log
--api-key API key for authentication super-secret-api-key
--upload-url URL or IP address of receiving server 0.0.0.0
--upload-port Port number of receiving server 8000

2.1.3 train

🚧 I'll add details here if you find you need to run the training script. 🚧

3. Metadata File Contents

The metadata file contains all of the information about the run.

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

software_hut_logger-0.1.0.tar.gz (131.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

software_hut_logger-0.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file software_hut_logger-0.1.0.tar.gz.

File metadata

  • Download URL: software_hut_logger-0.1.0.tar.gz
  • Upload date:
  • Size: 131.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for software_hut_logger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7c5f43c56a2e123136c5bd9acdd65178058d618249b0852082db963fa3939ea8
MD5 4500900a665035bcfd9f8170ccd43040
BLAKE2b-256 0d35fac39fe1dca9bccbfa5cb16a59bcb2a6e385b0a7bb21f9b6a0a89dcb0924

See more details on using hashes here.

File details

Details for the file software_hut_logger-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for software_hut_logger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7895237e1c49bab72bb7b6b755d45a9239c61ed9144a3b4a3251e1875461d39b
MD5 df0cc594662e739ddc19e3a63dc56bbc
BLAKE2b-256 8b02af0144fd431111a072e7192305d6ffe6a0f3c8b5cbd04be4dcd540316f96

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