Skip to content
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

运行main.py报错 #15

Open
lyyilin opened this issue Jan 20, 2025 · 6 comments
Open

运行main.py报错 #15

lyyilin opened this issue Jan 20, 2025 · 6 comments

Comments

@lyyilin
Copy link

lyyilin commented Jan 20, 2025

pygame 2.6.1 (SDL 2.28.4, Python 3.10.0)
Hello from the pygame community. https://www.pygame.org/contribute.html
funasr version: 1.1.6.
SileroVAD {'sampling_rate': 16000, 'threshold': 0.5, 'min_silence_duration_ms': 200}
(None,) {}
Traceback (most recent call last):
File "F:\myitem2\bailing\bailing\main.py", line 58, in
robot = robot.Robot(config_path)
File "F:\myitem2\bailing\bailing\bailing\robot.py", line 76, in init
self.memory = memory.Memory(config.get("Memory"))
File "F:\myitem2\bailing\bailing\bailing\memory.py", line 41, in init
self.client = openai.OpenAI(api_key=self.api_key, base_url=self.base_url)
File "D:\Anconda\envs\bailing\lib\site-packages\openai_client.py", line 110, in init
raise OpenAIError(
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

@DAAworld
Copy link

rag和mem里面的api_key也配上。

@lyyilin
Copy link
Author

lyyilin commented Jan 20, 2025 via email

@DAAworld
Copy link

好的,谢谢了,我去试一试!

你要是跑通了说一下,我现在卡在加载界面

@lyyilin
Copy link
Author

lyyilin commented Jan 21, 2025

2025-01-21 10:33:45,440 - sentence_transformers.SentenceTransformer - INFO - Load pretrained SentenceTransformer: models/bge-small-zh
2025-01-21 10:33:45,729 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-01-21 10:34:27,923 - chromadb.telemetry.product.posthog - INFO - Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
2025-01-21 10:34:28,029 - chromadb.config - DEBUG - Starting component System
2025-01-21 10:34:28,029 - chromadb.config - DEBUG - Starting component Posthog
2025-01-21 10:34:28,029 - chromadb.config - DEBUG - Starting component OpenTelemetryClient
2025-01-21 10:34:28,029 - chromadb.config - DEBUG - Starting component SqliteDB
2025-01-21 10:34:28,036 - chromadb.config - DEBUG - Starting component SimpleQuotaEnforcer
2025-01-21 10:34:28,036 - chromadb.config - DEBUG - Starting component SimpleRateLimitEnforcer
2025-01-21 10:34:28,036 - chromadb.config - DEBUG - Starting component LocalSegmentManager
2025-01-21 10:34:28,036 - chromadb.config - DEBUG - Starting component LocalExecutor
2025-01-21 10:34:28,036 - chromadb.config - DEBUG - Starting component SegmentAPI
Traceback (most recent call last):
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\models\CollectionCommon.py", line 90, in wrapper
return func(self, *args, **kwargs)
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\models\CollectionCommon.py", line 389, in _validate_and_prepare_upsert_request
upsert_records = normalize_insert_record_set(
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\types.py", line 187, in normalize_insert_record_set
base_record_set = normalize_base_record_set(
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\types.py", line 164, in normalize_base_record_set
embeddings=normalize_embeddings(embeddings),
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\types.py", line 61, in normalize_embeddings
raise ValueError(
ValueError: Expected Embedings to be non-empty list or numpy array, got []

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\myitem2\bailings\bailing\main.py", line 58, in
robot = robot.Robot(config_path)
File "F:\myitem2\bailings\bailing\bailing\robot.py", line 105, in init
rag.Rag(config["Rag"]) # 第一次初始化
File "F:\myitem2\bailings\bailing\bailing\rag.py", line 27, in new
cls._instance.init(config) # 初始化实例属性
File "F:\myitem2\bailings\bailing\bailing\rag.py", line 57, in init
vector_store = Chroma.from_documents(documents=splits, embedding=embedding_model)
File "D:\Anconda\envs\bailing\lib\site-packages\langchain_chroma\vectorstores.py", line 1128, in from_documents
return cls.from_texts(
File "D:\Anconda\envs\bailing\lib\site-packages\langchain_chroma\vectorstores.py", line 1089, in from_texts
chroma_collection.add_texts(texts=texts, metadatas=metadatas, ids=ids)
File "D:\Anconda\envs\bailing\lib\site-packages\langchain_chroma\vectorstores.py", line 557, in add_texts
self._collection.upsert(
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\models\Collection.py", line 334, in upsert
upsert_request = self._validate_and_prepare_upsert_request(
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\models\CollectionCommon.py", line 93, in wrapper
raise type(e)(msg).with_traceback(e.traceback)
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\models\CollectionCommon.py", line 90, in wrapper
return func(self, *args, **kwargs)
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\models\CollectionCommon.py", line 389, in _validate_and_prepare_upsert_request
upsert_records = normalize_insert_record_set(
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\types.py", line 187, in normalize_insert_record_set
base_record_set = normalize_base_record_set(
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\types.py", line 164, in normalize_base_record_set
embeddings=normalize_embeddings(embeddings),
File "D:\Anconda\envs\bailing\lib\site-packages\chromadb\api\types.py", line 61, in normalize_embeddings
raise ValueError(
ValueError: Expected Embedings to be non-empty list or numpy array, got [] in upsert.
2025-01-21 10:34:28,532 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): us.i.posthog.com:443
2025-01-21 10:34:29,828 - urllib3.connectionpool - DEBUG - https://us.i.posthog.com:443 "POST /batch/ HTTP/1.1" 200 15

上一个问题解决了,但是出现了新的问题,rag出错了,我正在尝试修复

@972449665
Copy link

发生异常: AttributeError
type object 'Chroma' has no attribute 'from_decuments'
File "/bailing-main/bailing/rag.py", line 56, in init
vector_store = Chroma.from_decuments(documents=splits, embedding=embedding_model)
File "/bailing-main/bailing/rag.py", line 27, in new
cls._instance.init(config) # 初始化实例属性
File "/bailing-main/bailing/robot.py", line 105, in init
rag.Rag(config["Rag"]) # 第一次初始化
File "/bailing-main/main.py", line 58, in
robot = robot.Robot(config_path)
AttributeError: type object 'Chroma' has no attribute 'from_decuments'

@DAAworld
Copy link

发生异常: AttributeError type object 'Chroma' has no attribute 'from_decuments' File "/bailing-main/bailing/rag.py", line 56, in init vector_store = Chroma.from_decuments(documents=splits, embedding=embedding_model) File "/bailing-main/bailing/rag.py", line 27, in new cls._instance.init(config) # 初始化实例属性 File "/bailing-main/bailing/robot.py", line 105, in init rag.Rag(config["Rag"]) # 第一次初始化 File "/bailing-main/main.py", line 58, in robot = robot.Robot(config_path) AttributeError: type object 'Chroma' has no attribute 'from_decuments'

注释掉Rag初始化。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants