인프런 커뮤니티 질문&답변
3.3 코드 에러
작성
·
107
0
3.3 LangChain 없이 구성하는 RAG의 불편함.ipynb
의 8번째
tax_collection = chroma_client.get_or_create_collection(collection_name, embedding_function=openai_embedding)에서 아래의 에러가 납니다.
ValueError: An embedding function already exists in the collection configuration, and a new one is provided. If this is intentional, please embed documents separately. Embedding function conflict: new: openai vs persisted: default
어떻게 해야하나요?
퀴즈
71%나 틀려요. 한번 도전해보세요!
RAG 시스템 구축 전, 문서 내용을 다루기 위해 가장 먼저 필요한 과정은 무엇일까요?
임베딩 모델 선택
텍스트 분할 (Splitting)
벡터 데이터베이스 선택
API 키 발급
답변 1
0
제이쓴
지식공유자
안녕하세요, 에러 메세지로 볼 때는 collection이 이미 존재하는 경우인 것 같습니다. 혹시 앞에서 진행하신 코드와 같은 이름을 사용하신다면 로컬에 생성된 크로마 디렉토리를 한번 지우고 다시 시도해보시거나, 임베딩 함수를 기준 컬렉션과 동일한 걸 사용하셔야 될 것 같습니다






ChromaDB가 업데이트되면서 embedding function 충돌 검증이 새로 추가됐습니다. 예전 버전에서는 create_collection으로 만든 뒤 get_or_create_collection에서 다른 embedding을 넘겨도 그냥 통과했는데, 지금은 엄격하게 막는 겁니다.
해결: create_collection 셀을 지우고, get_or_create_collection 하나로 통합하면 됩니다
claude 답변 복사해서 올립니다.