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

Fix cohere embedder #1353

Merged
merged 2 commits into from
May 22, 2024
Merged

Fix cohere embedder #1353

merged 2 commits into from
May 22, 2024

Conversation

LeonieFreisinger
Copy link
Contributor

@LeonieFreisinger LeonieFreisinger commented May 3, 2024

Description

Fix the usage of the cohere embedder. Changes:

  • add langchain_cohere package (from langchain_community.embeddings import CohereEmbeddings is deprecated)
  • add 'cohere' to the validate_config of the embedder model

Fixes # (issue)
#1346

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Please delete options that are not relevant.
test_langchain_default_concept() is failing. However, it also fails on the origin/main branch when running the test locally.

  • Test Script (please provide)
import os
from embedchain import App

os.environ["OPENAI_API_KEY"] = "sk-XXX"
os.environ["COHERE_API_KEY"] = "XXX"

app = App.from_config(config_path="config.yaml")

app.add("https://www.forbes.com/profile/elon-musk")
answer = app.query("What is the net worth of Elon Musk today?")
print(answer)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed

@LeonieFreisinger
Copy link
Contributor Author

@deshraj test_langchain_default_concept() is failing when running the code locally. It also fails when running origin/main code locally. Could this be due to my local setup?
I assume my fix does not cause the test to fail.

@deshraj
Copy link
Collaborator

deshraj commented May 3, 2024

@LeonieFreisinger thanks for pointing out. I will look into this and get it fixed soon.

Is your PR ready for review though? I will try to pull it on my local and test it if ready.

@LeonieFreisinger LeonieFreisinger marked this pull request as ready for review May 13, 2024 05:56
@LeonieFreisinger
Copy link
Contributor Author

@deshraj Thanks! Yes, besides this it is ready for review

@deshraj deshraj merged commit 9ba445e into embedchain:main May 22, 2024
0 of 3 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants