Skip to content

alexandrainst/alexandra_ai

This branch is up to date with main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4c697b3 Β· Dec 11, 2024

History

87 Commits
Dec 11, 2024
Aug 29, 2022
Mar 10, 2023
Aug 29, 2022
Feb 24, 2023
Feb 22, 2023
Aug 29, 2022
Feb 24, 2023
Feb 24, 2023
Feb 22, 2023
Aug 29, 2022
Feb 22, 2023
Aug 29, 2022
Oct 10, 2023
Feb 24, 2023
Mar 20, 2024
Aug 29, 2022
Mar 20, 2024

Repository files navigation

A Toolkit for Machine Learning Practitioners


PyPI Status Documentation License LastCommit Code Coverage

Installation

To install the package simply write the following command in your favorite terminal:

pip install alexandra-ai

If you're on MacOS and get an error saying something along the lines of "fatal error: 'lzma.h' file not found" then try the following:

export CPPFLAGS="-I$(brew --prefix)/include"
pip install alexandra-ai

Quickstart

Benchmarking from the Command Line

The easiest way to benchmark pretrained models is via the command line interface. After having installed the package, you can benchmark your favorite model like so:

evaluate --model-id <model_id> --task <task>

Here model_id is the HuggingFace model ID, which can be found on the HuggingFace Hub, and task is the task you want to benchmark the model on, such as "ner" for named entity recognition. See all options by typing

evaluate --help

The specific model version to use can also be added after the suffix '@':

evaluate --model_id <model_id>@<commit>

It can be a branch name, a tag name, or a commit id. It defaults to 'main' for latest.

Multiple models and tasks can be specified by just attaching multiple arguments. Here is an example with two models:

evaluate --model_id <model_id1> --model_id <model_id2> --task ner

See all the arguments and options available for the evaluate command by typing

evaluate --help

Benchmarking from a Script

In a script, the syntax is similar to the command line interface. You simply initialise an object of the Evaluator class, and call this evaluate object with your favorite models and/or datasets:

>>> from alexandra_ai import Evaluator
>>> evaluator = Evaluator()
>>> evaluator('<model_id>', '<task>')

Contributors

If you feel like this package is missing a crucial feature, if you encounter a bug or if you just want to correct a typo in this readme file, then we urge you to join the community! Have a look at the CONTRIBUTING.md file, where you can check out all the ways you can contribute to this package. ✨

  • Your name here? πŸŽ‰

Maintainers

The following are the core maintainers of the alexandra_ai package:

The AlexandraAI ecosystem

This package is a wrapper around other AlexandraAI packages, each of which is standalone:

Project structure

.
β”œβ”€β”€ .flake8
β”œβ”€β”€ .github
β”‚   └── workflows
β”‚       β”œβ”€β”€ ci.yaml
β”‚       └── docs.yaml
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .pre-commit-config.yaml
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ CODE_OF_CONDUCT.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ gfx
β”œβ”€β”€ makefile
β”œβ”€β”€ notebooks
β”œβ”€β”€ poetry.toml
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ alexandra_ai
β”‚   β”‚   └── __init__.py
β”‚   └── scripts
β”‚       β”œβ”€β”€ fix_dot_env_file.py
β”‚       └── versioning.py
└── tests
    └── __init__.py