参考:
Ollama平台里最流行的embedding模型: nomic-embed-text 模型介绍和实践-CSDN博客
https://blog.csdn.net/skywalk8163/article/details/145498041
https://docs.cherry-ai.com/knowledge-base/data
Installation — Sentence Transformers documentation
https://www.sbert.net/docs/installation.html
GitHub - huggingface/transformers: 🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://github.com/huggingface/transformers
快速入门 | 🦜️🔗 Langchain
https://python.langchain.com.cn/docs/get_started/quickstart
环境:
centos 7,anaconda3,CUDA 11.6
问题描述
公司希望定制一个知识库,结合大语言模型,让用户在提问的时候可以获得专注于生物学领域的答案。
本文只写一个快速实现的、粗略的方案。针对生物学领域的会在后续的文章中细化。
方案设计
参考Cherry Studio的方案。

关于Cherry Studio的简单使用见上篇:
win10-CherryStudio-简单使用+自定义知识库-CSDN博客
https://blog.csdn.net/pxy7896/article/details/146937655
实现
安装
// 创建conda环境.
conda create -n llm python=3.11
// 安装pytorch, gpu版(版本号是根据 CUDA 11.6 确定的)
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
// 安装transformers
pip install transformers
// 安装sentence-transformers
pip install -U sentence-transformers
// 安装langchain
pip --default-timeout=1000 install langchain
pip install langchain_community
说明:
sentence-transformers建议:Python 3.9+, PyTorch 1.11.0+, and transformers v4.41.0+- 安装
torch的时候可能太慢,可


被折叠的 条评论
为什么被折叠?



