semvec/pypi-packages huggingface dataset:
types-python-datemath 3.0.1.20250514
Typing stubs for python-datemath
Requires Python: >=3.9

## Typing stubs for python-datemath

This is a [PEP 561](https://peps.python.org/pep-0561/)
type stub package for the [`python-datemath`](https://github.com/nickmaccarthy/python-datemath) package.
It can be used by type-checking tools like
[mypy](https://github.com/python/mypy/),
[pyright](https://github.com/microsoft/pyright),
[pytype](https://github.com/google/pytype/),
[Pyre](https://pyre-check.org/),
PyCharm, etc. to check code that uses `python-datemath`. This version of
`types-python-datemath` aims to provide accurate annotations for
`python-datemath==3.0.1`.

*Note:* The `python-datemath` package includes type annotations or type stubs
since version 3.0.2. Please uninstall the `types-python-datemath`
package if you use this or a newer version.


This package is part of the [typeshed project](https://github.com/python/typeshed).
All fixes for types and metadata should be contributed there.
See [the README](https://github.com/python/typeshed/blob/main/README.md)
for more details. The source for this package can be found in the
[`stubs/python-datemath`](https://github.com/python/typeshed/tree/main/stubs/python-datemath)
directory.

This package was tested with
mypy 1.15.0,
pyright 1.1.400,
and pytype 2024.10.11.
It was generated from typeshed commit
[`9589e369f8afdd2980e45953e2ca9f2055d74c10`](https://github.com/python/typeshed/commit/9589e369f8afdd2980e45953e2ca9f2055d74c10).
TrackAlpaca 0.2
A Metric Tracking and Visualization Tool
Requires Python: >=3.9

# TrackAlpaca: A Metric Tracking and Visualization Tool

## Overview

`TrackAlpaca` is a simple and efficient class for logging, saving, loading, and visualizing metrics over multiple epochs. It is perfect for tracking machine learning metrics such as loss and accuracy during training. The class supports saving metrics to a JSON file, loading them for analysis, and graphing them as images for visualization.

## Features

- **Log Metrics**: Log multiple metrics (e.g., loss, accuracy) for each training epoch.
- **Save Metrics**: Persist logged metrics to a JSON file for future analysis.
- **Load Metrics**: Load previously saved metrics from a JSON file.
- **Graph Metrics**: Generate graphs visualizing the metrics over epochs and save them as image files.

## Requirements

- Python 3.9 (tested with 3.12.7)
- `matplotlib` for graphing.
- `PIL` (Pillow) for handling image data.

## Installation

You can install `TrackAlpaca` directly from PyPI by running:

```bash
pip install TrackAlpaca
langtrain 0.0.4
Language Model Training Library
Requires Python: >=3.10
Keywords: nlp, cv, language model, model training, langtrain

![Python](https://img.shields.io/badge/python-3670A0?style=plastic&logo=python&logoColor=ffdd54) ![PyTorch](https://img.shields.io/badge/PyTorch-%23EE4C2C.svg?style=plastic&logo=PyTorch&logoColor=white)


![alt text](docs/static/logo.png)


## A python package for training Language Models from scratch with few lines of code

LangTrain is a python package for training Language Models from scratch. It provides a simple interface to train large Language Models from scratch with few lines of code.

## Installation

#### Stable Version
```bash
pip install langtrain
```

#### Development Version
```bash
pip install git+https://github.com/sayedshaun/langtrain.git
```

## Usage

#### Quick Start

```python
import langtrain as lt

data_path = "data_directory"
tokenizer = lt.tokenizer.SentencePieceTokenizer(data_path, vocab_size=5000)
dataset = lt.dataset.SimpleCausalDataset(data_path, tokenizer, n_ctx=512)
model = lt.model.LlamaModel(
    lt.model.LlamaConfig(
        vocab_size=tokenizer.vocab_size,
        hidden_size=512,
        hidden_layers=8,
        num_heads=8,
        dropout=0.2,
        norm_epsilon=1e-6,
        max_seq_len=dataset.n_ctx,
    )
)
train_config=lt.config.TrainingConfig(
    epochs=5,
    batch_size=4,
    learning_rate=1e-4,
    device="cuda",
    precision="fp16",
)
trainer = lt.trainer.Trainer(
    model=model,
    train_config=train_config,
    dataset=dataset,
    tokenizer=tokenizer,
    collate_fn=lt.utils.collate_fn,
    model_name="nano-llama",
)
trainer.train()
```

#### Pretrained Detailes:
Once the model is trained the pretrained dicretory will looks like this:
```
nano-llama/
    ├── /checkpoint-200
    ├── train_config.yaml
    ├── model_config.yaml
    ├── pytorch_model.pt
    ├── VOCAB.model
    └── VOCAB.vocab
```

#### Inference

```python
import langtrain as lt

tokenizer = lt.tokenizer.Tokenizer.from_pretrained("nano-llama")
model = lt.model.LlamaModel.from_pretrained("nano-llama")
inputs = tokenizer.encode("Sherlock Holmes")
output = model.generate(inputs, eos_id=tokenizer.eos_token_id, max_new_tokens=50)
tokenizer.decode(output)
```
More tutorial can be found [here](docs/tutorial/tutorial.md)
## Available Model Architectures to train

| Architecture | Source |
|--------------------|--------------------------------------------|
| GPT                | [OpenAI GPT](https://openai.com/index/language-unsupervised/) |
| LLaMA              | [Meta LLaMA](https://arxiv.org/abs/2302.13971) |
| BERT               | [Google BERT](https://arxiv.org/abs/1810.04805) |
| VIT                | [Vision Transformer](https://arxiv.org/abs/2010.11929) |