No project description provided
Project description
HELMET: Human Evaluated large Language Model Explainability Tool
Contents
- Installation helmet
- Configuration Details
- Features
- Install Helmet from source
- Deploy helmet-platform (local)
- License
Pypi Installation
pip install helmet
Overview
This package exists of two parts;
- A python package;
helmet
, which you can install in your Jupyter Notebook/Sagemaker/Colab - A webapp:
helmet-platform
, which deploys an API to save al the runs & projects and interacts with the frontend. A frontend should also be deployed.
Configuration files
Platform configuration
project_name = "Project Name"
project_id = "Id" # (get from frontend or code)
platform_url = "https://" # Please do not change this
Model configuration
# This should be the name as is presented on Huggingface 🤗
checkpoint = "meta-llama/Meta-Llama-3-8B-Instruct"
# The embeddings are needed for the XAI part. This varies between models, thus please provide it yourself.
embeddings = "model.embed_tokens"
# This is for wrapper to know what kind of model it is.
model_type = "dec"
Model Args
# This is needed to use Llama-3
access_token = "hf_"
# You can add more here if you like
model_args = {
"token": access_token
}
Run configuration
run_config = {
# "cuda" & "cpu" are currently supported
"device": device,
}
Load/create project
Creating a project can be done by current the following python code in your jupyter notebook.
project_id = get_or_create_project(platform_url, project_name, "text_generation")
This will give you back the ID of the project, that you can then use to load the model.
After you have configured the model, platform & device, you can start loading the model like this:
model = from_pretrained(checkpoint, model_type, embeddings, project_id, device, platform_url, model_args)
Features
- Load any causal model from Huggingface.
- Create a project for your experiment
- Run experimental prompts
Demo
A demo can be found at https://helmet.jeroennelen.nl
Component architecture
Install from source
To use helmet in one of the examples perform the following steps:
- Create venv with
python -m venv .venv
- Activate the venv with
source .venv/bin/activate
- Install HELMET from source (from git, when located in the home folder of helmet
pip install -e .
- Install jupyter notebook
pip install jupyterlab
To remove:
deactivate
jupyter-kernelspec uninstall venv
rm -r venv
Running webapp locally
For this, please check the README
in the webapp
Credits
Some inspiration has been drawn from a couple of other tools:
License
helmet
is distributed under the terms of the MIT license.
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
Built Distribution
File details
Details for the file helmet-1.1.1.tar.gz
.
File metadata
- Download URL: helmet-1.1.1.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28650880662d5fefc37970ee56ccc72f92d0bd5fc82fa191ca7ace9ab7d2fb15 |
|
MD5 | 25f81713008721868a94761964142cf8 |
|
BLAKE2b-256 | 5b6286ed4a14dd37bc335b436064745aeadcc28d679b0eb1c2715248fe29daf1 |
File details
Details for the file helmet-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: helmet-1.1.1-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45d91d466e8a98009e311f9e42fad85426236a1aa29914a88196dd8383bd512c |
|
MD5 | 5fc1728074969a0143ae3857ddfe609f |
|
BLAKE2b-256 | 635d650e7005fec8d21c5d311361be416e8d69a5e2b55b324ce7f6bc08ce5479 |