/last

LLM Alignment and Safety Toolkit

Primary LanguagePythonOtherNOASSERTION

LAST

LLM Alignment and Safety Toolkit

Installation

not supported yet

Usage

not supported yet

Pre-requisites

  1. [Optinal] Install conda if you want to keep your system clean. Then create a conda environment.
conda create -n last python=3.8
conda activate last
  1. Install poetry

  2. Install redis

Run dashboard in local

create a .env file in the root directory of the project and add the following variables

DATABASE_URL=sqlite://dashboard/app.sqlite3
REDIS_URL=redis://localhost:6379/0

then go to the project directory and run the following commands

poetry install && make compile
poetry run python dashboard/app.py

If this is the first time you run the dashboard, you need to create an admin user by visiting http://127.0.0.1:8000/admin/init

For more detail, checkout Dockfile and docker-compose.yml in case I miss something.

Locales

当需要使用中文时,使用from last.services.i18n import _代替_,并在需要翻译的字符串前加上_,例如:

from last.services.i18n import _
label = _('label')

之后,使用make babel提取需要翻译的字符串,文件存储在last/services/locales/zh_CN/LC_MESSAGES/messages.po。 修改完成后,使用make compile编译翻译文件。