semvec/pypi-packages huggingface dataset:
adam-mini 1.1.1
Adam-mini Optimizer
Requires Python: >=3.8

# Adam-mini
This is the official PyTorch implementation of Adam-mini,  a mini-version of Adam that achieves on-par or better performance than AdamW with **45% to 50%** less memory footprint.  

Paper: [Adam-mini: Use Fewer Learning Rates To Gain More](https://arxiv.org/abs/2406.16793).

Github repo: https://github.com/zyushun/Adam-mini

## How to use 

Install torch (>=1.8.0) and run the following commands.

```
pip install adam-mini
```

or if you prefer to import from source

```
git clone https://github.com/zyushun/Adam-mini
cd Adam-mini
pip install -e .
```

Then use Adam-mini optimizer as follows.

```
from adam_mini import Adam_mini

optimizer = Adam_mini(
            named_parameters = model.named_parameters(), 
            lr = lr, 
            betas = (beta1,beta2), 
            eps = eps,
            weight_decay = weight_decay, 
            dim = model_config.dim,
            n_heads = model_config.n_heads,
            n_kv_heads = model_config.n_kv_heads,
            )        
```



**Hyperparameter choices:** Regarding learning rate (lr), weight_decay, beta1, beta2, eps, we recommend using the same values as those used for AdamW.

If you are training Transformers, please also pass the following info to Adam-mini:

- dim: dimension for hidden feature. Could be unspecified if you are training non-transformer models.

- n_heads: number of attention heads. Could be unspecified if you are training non-transformer models.

- n_kv_heads: number of head for Key and Value. Or equivalently, number of query groups in Group query Attention. Also known as "n_query_groups".  If is None, it will be the same value as n_head. Could be unspecified if you are training non-transformer models.

## Citation

If you find this code helpful, please cite our paper in the following format.

```
@article{zhang2024adam,
  title     = {Adam-mini: Use Fewer Learning Rates To Gain More},
  author    = {Zhang, Yushun and Chen, Congliang  and Li, Ziniu and Ding, Tian and Wu, Chenwei and Ye, Yinyu and Luo, Zhi-Quan and Sun, Ruoyu},
  booktitle = {arXiv preprint arXiv:2406.16793},
  year      = {2024},
}
```
es-pandas 0.0.23
Read, write and update large scale pandas DataFrame with ElasticSearch

# es_pandas
[![Build Status](https://travis-ci.org/fuyb1992/es_pandas.svg?branch=master)](https://travis-ci.org/fuyb1992/es_pandas) <a href="https://996.icu"><img src="https://img.shields.io/badge/link-996.icu-red.svg" alt="996.icu" /></a> [![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE) [![PyPi version](https://img.shields.io/pypi/v/es_pandas)](https://pypi.org/project/es-pandas/)
[![Downloads](https://pepy.tech/badge/es-pandas/month)](https://pepy.tech/project/es-pandas)

 Read, write and update large scale [pandas](http://pandas.pydata.org/) DataFrame  with [ElasticSearch](https://www.elastic.co/).
 

## Requirements
This package should work on Python3(>=3.4) and ElasticSearch should be version 5.x, 6.x or 7.x.

Installation
The package is hosted on PyPi and can be installed with pip:
```
pip install es_pandas
```
#### Deprecation Notice

Supporting of ElasticSearch 5.x will by deprecated in future version.

## Usage

```
import time

import pandas as pd

from es_pandas import es_pandas


# Information of es cluseter
es_host = 'localhost:9200'
index = 'demo'

# crete es_pandas instance
ep = es_pandas(es_host)

# Example data frame
df = pd.DataFrame({'Num': [x for x in range(100000)]})
df['Alpha'] = 'Hello'
df['Date'] = pd.datetime.now()

# init template if you want
doc_type = 'demo'
ep.init_es_tmpl(df, doc_type)

# Example of write data to es, use the template you create
ep.to_es(df, index, doc_type=doc_type, thread_count=2, chunk_size=10000)

# set use_index=True if you want to use DataFrame index as records' _id
ep.to_es(df, index, doc_type=doc_type, use_index=True, thread_count=2, chunk_size=10000)

# delete records from es
ep.to_es(df.iloc[5000:], index, doc_type=doc_type, _op_type='delete', thread_count=2, chunk_size=10000)

# Update doc by doc _id
df.iloc[:1000, 1] = 'Bye'
df.iloc[:1000, 2] = pd.datetime.now()
ep.to_es(df.iloc[:1000, 1:], index, doc_type=doc_type, _op_type='update')

# Example of read data from es
df = ep.to_pandas(index)
print(df.head())

# return certain fields in es
heads = ['Num', 'Date']
df = ep.to_pandas(index, heads=heads)
print(df.head())

# set certain columns dtype
dtype = {'Num': 'float', 'Alpha': object}
df = ep.to_pandas(index, dtype=dtype)
print(df.dtypes)

# infer dtype from es template
df = ep.to_pandas(index, infer_dtype=True)
print(df.dtypes)

# use query_sql parameter if you want to do query in sql

# Example of write data to es with pandas.io.json
ep.to_es(df, index, doc_type=doc_type, use_pandas_json=True, thread_count=2, chunk_size=10000)
print('write es doc with pandas.io.json finished')
```
vehicle-form-validator 1.0.0
A library to validate vehicle and user details
Requires Python: >=3.7

# Vehicle Form Validation Library

The library allows you to validate your form inputs using OOPS principles. It has cutomized fields like vehicle make, vehicle type etc also it provides liscence validations specific to country. In addtion to vehicles it provides user details validations.


## Installation

Install the library with:
pip install vehicle_form_validator

## USAGE

from vehicle_form_validator import FieldValidator

# Vehicle Number Validation
vehicle_number = "AB-07-8746"
if FieldValidator.validate_vehicle_number(vehicle_number):
    print(f"'{vehicle_number}' is a valid vehicle number.")
else:
    print(f"'{vehicle_number}' is an invalid vehicle number.")

# Vehicle Type Validation
vehicle_type = "Car"
if FieldValidator.validate_vehicle_type(vehicle_type):
    print(f"'{vehicle_type}' is a valid vehicle type.")
else:
    print(f"'{vehicle_type}' is an invalid vehicle type.")

# Vehicle Make Validation
vehicle_make = "Mahindra"
if FieldValidator.validate_vehicle_make(vehicle_make):
    print(f"'{vehicle_make}' is a valid vehicle make.")
else:
    print(f"'{vehicle_make}' is an invalid vehicle make.")

# Vehicle Model Validation
vehicle_model = "XUV 700"
if FieldValidator.validate_vehicle_model(vehicle_model):
    print(f"'{vehicle_model}' is a valid vehicle model.")
else:
    print(f"'{vehicle_model}' is an invalid vehicle model.")

# License Plate Validation (Ireland)
license_plate = "12-34ABC"
if FieldValidator.validate_license_plate(license_plate, country_code="IE"):
    print(f"'{license_plate}' is a valid license plate for Ireland.")
else:
    print(f"'{license_plate}' is an invalid license plate for Ireland.")

# Phone Number Validation (Ireland)
phone_number = "+353123456789"
if FieldValidator.validate_phone_number(phone_number, country_code="IE"):
    print(f"'{phone_number}' is a valid Irish phone number.")
else:
    print(f"'{phone_number}' is an invalid Irish phone number.")

# Email Validation
email = "test@example.com"
if FieldValidator.validate_email(email):
    print(f"'{email}' is a valid email address.")
else:
    print(f"'{email}' is an invalid email address.")

# Password Validation
password = "Password123!"
confirm_password = "Password123!"
valid, message = FieldValidator.validate_password(password, confirm_password)
if valid:
    print("Password is valid.")
else:
    print(f"Password is invalid: {message}")

# Full Name Validation
full_name = "John Doe"
if FieldValidator.validate_full_name(full_name):
    print(f"'{full_name}' is a valid full name.")
else:
    print(f"'{full_name}' is an invalid full name.")