This project has been archived by its maintainers, and is no longer receiving any updates.
transformerlab-client
Python client and callbacks for Transformer Lab.
Install
pip install transformerlab-client
Prerequisites
- Python 3.10 or newer
- A running instance of the Transformer Lab API server
- By default, the client connects to
http://localhost:8338 - Make sure the Transformer Lab application is running before using this client
- By default, the client connects to
Usage
from transformers import TrainingArguments, Trainer
from transformerlab_client.client import TransformerLabClient
from transformerlab_client.callbacks.hf_callback import TLabProgressCallback
# Initialize client and register job
client = TransformerLabClient(server_url="<ENTER YOUR TRANSFORMER LAB API URL>")
job_id = client.start(your_config)
# Set up Hugging Face trainer with TLabProgressCallback
training_args = TrainingArguments(
output_dir="./output",
# other arguments...
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=train_dataset,
# other arguments...
callbacks=[TLabProgressCallback(client)] # Add Transformer Lab callback
)
# Train the model
trainer.train()
# Complete the job
client.complete()
Full Training Example
See the examples directory for a complete training script that demonstrates how to use the client for a full training workflow with Hugging Face Transformers.
API Reference
TransformerLabClient
Main client for communicating with Transformer Lab.
start(config): Register a training job and get a job IDreport_progress(progress, metrics=None): Report training progress (0-100) and any metrics in json formatcomplete(message="Training completed successfully"): Mark job as completestop(message="Training stopped"): Mark job as stoppedsave_model(saved_model_path): Save model to specified pathlog_info(message): Log info messagelog_error(message): Log error messagelog_warning(message): Log warning messagelog_debug(message): Log debug message
TLabProgressCallback
Callback for Hugging Face Transformers Trainer that reports progress to Transformer Lab.
Metadata
Release files for transformerlab-client 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| transformerlab_client-0.1.4.tar.gz | 42.8 kB | Without provenance | Details for transformerlab_client-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| transformerlab_client-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for transformerlab_client-0.1.4-py3-none-any.whl |
Total release size: 74.5 kB
Release files / transformerlab_client-0.1.4.tar.gz
| Download URL | transformerlab_client-0.1.4.tar.gz |
|---|---|
| Size | 42.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78601ee387c82d675b52782caea8e1eaececb1159baf7513b7c9388b5f653019
|
|
BLAKE2b-256 checksum How to use checksums |
58ad192f201d12ddd15b7936f7effe2a3936e7e69e3922fa2931b4ff024a78f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / transformerlab_client-0.1.4-py3-none-any.whl
| Download URL | transformerlab_client-0.1.4-py3-none-any.whl |
|---|---|
| Size | 31.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7650d278677cb3b9ca35dc542cf6a5c30658bb41ffc9a8edd392f66d8d71c8f0
|
|
BLAKE2b-256 checksum How to use checksums |
5816bb480f0cd7bbf9a434bed7251de96394d0eb6b68fad28d5ef8ce4011e295
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for transformerlab-client 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.