SetFit 文档
安装
加入 Hugging Face 社区
并获得增强的文档体验
开始使用
安装
在开始之前,您需要设置环境并安装相应的软件包。🤗 SetFit 经过 Python 3.9+ 测试。
pip
安装 🤗 SetFit 最直接的方法是使用 pip
pip install setfit
如果您有支持 CUDA 的显卡,建议安装支持 CUDA 的 torch
,以便更快地训练和执行推理。
pip install torch --index-url https://download.pytorch.org/whl/cu118
从源代码安装
从源代码构建 🤗 SetFit 可以让您更改代码库。要从源代码安装,请克隆存储库并使用以下命令以可编辑模式安装 🤗 SetFit
git clone https://github.com/huggingface/setfit.git
cd setfit
pip install -e .
如果您只想使用最新版本而不进行任何更改,请运行以下命令从源代码安装
pip install git+https://github.com/huggingface/setfit.git
Conda
如果 Conda 是您首选的包管理系统,那么您可以这样安装 🤗 SetFit
conda install -c conda-forge setfit