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

Cohere integration not working #1247

Open
pratikkotian04 opened this issue Feb 7, 2024 · 2 comments
Open

Cohere integration not working #1247

pratikkotian04 opened this issue Feb 7, 2024 · 2 comments

Comments

@pratikkotian04
Copy link

🐛 Describe the bug

I am loading the app using cohere api key , but the error still shows OpenAI key needed

Code :
os.environ["COHERE_API_KEY"] = "xxx"

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

Output:
KeyError Traceback (most recent call last)
in <cell line: 3>()
1 os.environ["COHERE_API_KEY"] = "xxx"
2
----> 3 app = App.from_config(config_path="/content/config.yaml")

3 frames
/usr/lib/python3.10/os.py in getitem(self, key)
678 except KeyError:
679 # raise KeyError with the original key value
--> 680 raise KeyError(key) from None
681 return self.decodevalue(value)
682

KeyError: 'OPENAI_API_KEY'

@taranjeet
Copy link
Member

Hey @pratikkotian04 thanks for reporting the issue.
I just checked the code and realized that this is happening because we dont have support for embeddings model via Cohere. (Issue #1248 for tracking)

For now, can you please try any other embedding model provider like hugging face or together ai?

Here is the complete config file. It includes cohere as the llm and hugging face as the embedding model.

llm:
  provider: cohere
  config:
    model: large
    temperature: 0.5
    max_tokens: 1000
    top_p: 1
embedder:
  provider: huggingface
  config:
    model: 'sentence-transformers/all-mpnet-base-v2'

Let me know if it doesnt work for you.

@pratikkotian04
Copy link
Author

pratikkotian04 commented Feb 7, 2024 via email

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