embedding太慢,解决方法
import torch
device = "mps" if torch.backends.mps.is_available() else "cpu"
embed_model = HuggingFaceEmbedding(
model_name="BAAI/bge-large-zh-v1.5",
device=device,
embed_batch_size=16,
)
同时确认
python - <<EOF
import torch
print(torch.backends.mps.is_available())
EOF
看到True
才说明你真的在用 Apple GPU
device = "mps" if torch.backends.mps.is_available() else "cpu"
embed_model = HuggingFaceEmbedding(
model_name="BAAI/bge-large-zh-v1.5",
device=device,
embed_batch_size=16,
)
同时确认
python - <<EOF
import torch
print(torch.backends.mps.is_available())
EOF
看到True
才说明你真的在用 Apple GPU
全部评论
苹果GPU炼丹日常踩坑
慢慢调,总会快的
相关推荐
01-16 11:50
浙江工商大学 Java 点赞 评论 收藏
分享

查看5道真题和解析