embedding模型部署调用出现接口调用不一致

代码一
embeddings = client.embeddings.create( model='Qwen/Qwen3-Embedding-8B-GGUF"', input=texts, # 直接传入文本列表 encoding_format="float" )

代码二:
```embeddings = OpenAIEmbeddings(
base_url="https://api-inference.modelscope.cn/v1",
api_key="",
model="Qwen/Qwen3-Embedding-8B-GGUF",
tiktoken_enabled=False,
timeout=30.0,
skip_empty=True,
headers={"User-Agent": "Mozilla/5.0"}
)


出现调用

faiss_index = FAISS.from_texts(texts, embeddings) 报错,
```使用LangChain创建嵌入向量并构建FAISS索引...
创建FAISS索引...
发生错误: We couldn't connect to 'https://huggingface.co' to load the files, and couldn't find them in the cached files.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
故障排除提示:
1. 检查网络连接
2. 如果在受限网络环境中,请取消代理设置注释
3. 确保ModelScope API密钥有效
4. 尝试使用不同的嵌入模型

展开
收起
robotliu0327_nwhel 2025-11-11 15:04:44 36 分享 版权
0 条回答
写回答
取消 提交回答

包含命名实体识别、文本分类、分词、关系抽取、问答、推理、文本摘要、情感分析、机器翻译等多个领域

热门讨论

热门文章

还有其他疑问?
咨询AI助理