异常Sorry, unable to generate embeddings with model shibing624/text2vec-base-chinese

#14
by siwen666 - opened

我在HuggingFace使用模型时,提示上面这个异常,请求的curl 如下
curl 'http://localhost:5000/embeddings/shibing624/text2vec-base-chinese'
-X POST
-H "Content-Type: application/json"
-d '{"inputs": ["test string 1", "test string 2"]}'
shibing624/text2vec-base-chinese 这个模型我已经安装到本地了,但是想通过HuggingFace去使用时一直提示找不到,是不是需要配置啥?
另外下面这段我也执行了,貌似也没啥用,想问下这个问题怎么解决,盼复!
from transformers import AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained("shibing624/text2vec-base-chinese")
model = AutoModel.from_pretrained("shibing624/text2vec-base-chinese")

下载到本地后,AutoModel.from_pretrained 后面写本地模型文件夹绝对路径。

shibing624 changed discussion status to closed

已经改成本地模型文件夹绝对路径并且执行都没问题
image.png
还是提示Sorry, unable to generate embeddings with model home/text2vec-large-chinese

siwen666 changed discussion status to open

用local模式加载hf模型,并执行推理。参考https://huggingface.co/shibing624/text2vec-base-chinese#usage-text2vec

另外,你的图片我看不到。

siwen666 changed discussion status to closed

Sign up or log in to comment