-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
配置Azure Openai时,只能使用GPT模型,不能使用embedding模型 #3827
Comments
您遇到的问题可能是因为Azure OpenAI可能不直接支持"text-embedding-ada-002"模型,或者在配置和使用嵌入模型时存在问题。这里有一些步骤和建议可能帮助您解决这个问题:
如果在尝试上述步骤后仍然遇到问题,可能需要联系Azure支持以获取更具体的帮助,或者检查是否有关于如何在Azure OpenAI平台上使用嵌入模型的最新指南或文档更新。 希望这些建议能帮助您解决问题。如果您有任何其他问题或需要更多帮助,请随时提问。
|
@dosu 实际上,Azure Openai支持这个模型,而且我在别的程序中使用很正常。但我没有在配置文件中发现输入模型名称、endpoint的地方。 |
To address the issue with configuring the "text-embedding-ada-002" model in Azure OpenAI within your project, follow these refined steps:
Make sure all changes are saved and test your setup again. For further guidance, you might want to refer to the example configuration file in the Langchain-Chatchat repository, specifically the model_config.py.example file, to ensure your configuration aligns with expected standards.
|
是的,因为没有这个API的接入 |
问题描述 / Problem Description
配置Azure Openai时,只能使用GPT模型,不能使用embedding模型。只有OpenAI原版embedding模型的配置,没有Azure Openai的。
复现问题的步骤 / Steps to Reproduce
"text-embedding-ada-002": Azure Openai key
2024-04-21 17:02:41,700 - _base_client.py[line:986] - INFO: Retrying request to /embeddings in 0.989405 seconds
2024-04-21 17:03:24,783 - _base_client.py[line:986] - INFO: Retrying request to /embeddings in 1.698303 seconds
2024-04-21 17:04:08,597 - embeddings_api.py[line:39] - ERROR: Request timed out.
AttributeError: 'NoneType' object has no attribute 'conjugate'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\polly\Langchain-Chatchat\init_database.py", line 107, in
folder2db(kb_names=args.kb_name, mode="recreate_vs", embed_model=args.embed_model)
File "C:\Users\polly\Langchain-Chatchat\server\knowledge_base\migrate.py", line 121, in folder2db
kb.create_kb()
File "C:\Users\polly\Langchain-Chatchat\server\knowledge_base\kb_service\base.py", line 81, in create_kb
self.do_create_kb()
File "C:\Users\polly\Langchain-Chatchat\server\knowledge_base\kb_service\faiss_kb_service.py", line 51, in do_create_kb
self.load_vector_store()
File "C:\Users\polly\Langchain-Chatchat\server\knowledge_base\kb_service\faiss_kb_service.py", line 28, in load_vector_store
return kb_faiss_pool.load_vector_store(kb_name=self.kb_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\polly\Langchain-Chatchat\server\knowledge_base\kb_cache\faiss_cache.py", line 102, in load_vector_store
vector_store = self.new_vector_store(embed_model=embed_model, embed_device=embed_device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\polly\Langchain-Chatchat\server\knowledge_base\kb_cache\faiss_cache.py", line 60, in new_vector_store
vector_store = FAISS.from_documents([doc], embeddings, normalize_L2=True,distance_strategy="METRIC_INNER_PRODUCT")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\polly.pyenv\pyenv-win\versions\3.11.9\Lib\site-packages\langchain_core\vectorstores.py", line 508, in from_documents
return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\polly.pyenv\pyenv-win\versions\3.11.9\Lib\site-packages\langchain_community\vectorstores\faiss.py", line 959, in from_texts
embeddings = embedding.embed_documents(texts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\polly\Langchain-Chatchat\server\knowledge_base\kb_service\base.py", line 439, in embed_documents
return normalize(embeddings).tolist()
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\polly\Langchain-Chatchat\server\knowledge_base\kb_service\base.py", line 37, in normalize
norm = np.linalg.norm(embeddings, axis=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\polly.pyenv\pyenv-win\versions\3.11.9\Lib\site-packages\numpy\linalg\linalg.py", line 2582, in norm
s = (x.conj() * x).real
^^^^^^^^
TypeError: loop of ufunc does not support argument 0 of type NoneType which has no callable conjugate method
环境信息 / Environment Information
附加信息 / Additional Information
添加与问题相关的任何其他信息 / Add any other information related to the issue.
The text was updated successfully, but these errors were encountered: