sentence-similarity - 如何在训练后在本地保存 SetFit 训练器

标签 sentence-similarity huggingface sentence-transformers

我在 HPC 上工作,工作节点上没有互联网访问权限,训练后保存 SetFit 训练器的唯一选择是将其推送到 HuggingFace hub。如何将其保存到本地磁盘?

https://github.com/huggingface/setfit

最佳答案

setfit有这个类方法

model._save_pretrained(save_directory)

并加载它

saved_model = SetFitModel._from_pretrained(save_directory)

关于sentence-similarity - 如何在训练后在本地保存 SetFit 训练器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74046426/

相关文章:

google-drive-api - 将 Google Colab 笔记本中的 Huggingface 缓存设置到 Google Drive

nlp - 与 BERT 的字符串比较似乎忽略了句子中的 "not"

huggingface-transformers - 如何知道HuggingFace的管道文本输入是否超过512个 token

huggingface - 微调开放式法学硕士

nlp - 余弦相似度涉及嵌入,我们是否必须嵌入整个句子/文本?

wordnet - 给定单词相似性推断句子相似性

python - 分割层输出时,Keras 抛出 `' Tensor' object has no attribute '_keras_shape'`

python - TypeError : Fetch argument array has invalid type numpy. ndarray,必须是字符串或Tensor。 (不能将 ndarray 转换为张量或操作。)

python - 如何结合doc2vec的PV-DM和PV-DBOW方法生成的向量?