项目简介
用于分析LLM工作原理的交互工具包
与之前的LLM推理可视化项目(
https://
bbycroft.net/llm
)类似,都是用于透视推理过程。
关键功能
安装
Dockerized 运行
# From the repository root directory
docker build -t llm_transparency_tool .
docker run --rm -p 7860:7860 llm_transparency_tool
本地安装
# download
git clone [email protected]:facebookresearch/llm-transparency-tool.git
cd llm-transparency-tool
# install the necessary packages
conda env create --name llmtt -f env.yaml
# install the `llm_transparency_tool` package
pip install -e .
# now, we need to build the frontend
# don't worry, even `yarn` comes preinstalled by `env.yaml`
cd llm_transparency_tool/components/frontend
yarn install
yarn build
启动
streamlit run llm_transparency_tool/server/app.py -- config/local.json
添加自己的LLM
最初,该工具只允许您从少数几个模型中进行选择。
以下是您可以尝试在工具中使用模型的选项,从最少到最多。
TransformerLens 已经支持该模型
完整的型号列表在这里。在这种情况下,可以将模型添加到配置 json 文件中。
TransformerLens 支持的模型的调整版本
将模型的正式名称以及从中读取权重的位置添加到配置中。
TransformerLens 不支持该模型
在这种情况下,UI 不知道如何为模型创建正确的钩子。您需要实现 TransparentLlm 类的版本,并更改 Streamlit 应用以使用您的实现。