diff --git a/dsRag/Pip维护.txt b/dsRag/Pip维护.txt new file mode 100644 index 00000000..56c430dc --- /dev/null +++ b/dsRag/Pip维护.txt @@ -0,0 +1,7 @@ +# 永久修改pip源为阿里云镜像源(适用于Windows系统) +pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ + +# 验证是否修改成功 +pip config list + +global.index-url='https://mirrors.aliyun.com/pypi/simple/' \ No newline at end of file diff --git a/dsRag/T2_Txt2Vec.py b/dsRag/T2_Txt2Vec.py new file mode 100644 index 00000000..ec021191 --- /dev/null +++ b/dsRag/T2_Txt2Vec.py @@ -0,0 +1,12 @@ +# 安装向量化的包 +# conda activate rag +# 断开VPN后执行安装包 +# pip install text2vec + + +from text2vec import SentenceModel +sentences = ['如何更换花呗绑定银行卡', '花呗更改绑定银行卡'] + +model = SentenceModel('shibing624/text2vec-base-chinese') +embeddings = model.encode(sentences) +print(embeddings) \ No newline at end of file