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

Embedchain upgrade to latest version error #2027

Open
Rainismer opened this issue Nov 14, 2024 · 4 comments
Open

Embedchain upgrade to latest version error #2027

Rainismer opened this issue Nov 14, 2024 · 4 comments

Comments

@Rainismer
Copy link

🐛 Describe the bug

Using embedchain version 0.1.124 everything works fine, but when upgrading to 0.1.125, chroma errors occur.

TypeError: SegmentAPI.get_or_create_collection() got an unexpected keyword argument 'embedding_function'

@AbhigyaWangoo
Copy link

AbhigyaWangoo commented Nov 17, 2024

The key problem is the version upgrade from 0.1.124 to 0.1.125 causing a TypeError with SegmentAPI's get_or_create_collection() method, specifically related to the embedding_function argument.

Here's a step-by-step resolution:

  1. Update ChromaDB Dependency
    First, ensure you're using a compatible version of ChromaDB. Update to at least version 0.4.13:
pip install chromadb>=0.4.13
  1. Modify Collection Initialization
    Update your code to explicitly handle collection creation:
from embedchain import App

# Option 1: Specify collection name explicitly
app = App(config={
    "collection_name": "my_custom_collection"
})

# Option 2: If using a specific embedding function
from embedchain.embedder.openai import OpenAIEmbedder

embedder = OpenAIEmbedder()
app = App(embedder=embedder)
  1. Potential Configuration Workaround
    If the above doesn't work, create a configuration file (config.yaml):
vectordb:
  provider: chroma
  config:
    collection_name: 'my-app-collection'
  1. Clean Slate Approach
    If persistent issues occur:
  • Delete existing Chroma DB folder
  • Ensure embedding dimensions match your vector store configuration
  • Reinstall Embedchain and ChromaDB

Recommendations:

  • Verify you're using the latest compatible versions
  • Check embedding dimension compatibility
  • Ensure proper collection initialization

Would you like me to elaborate on any of these steps or do you need more specific guidance based on your exact implementation?

@Rainismer
Copy link
Author

@AbhigyaWangoo Thank you for your reply, but it doesn't work for me.

@AbhigyaWangoo
Copy link

What specifically won't work for you?

@Rainismer
Copy link
Author

@AbhigyaWangoo
image

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

2 participants