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

Add cohere models #1538

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion mteb/leaderboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from pathlib import Path

import gradio as gr
import pandas as pd
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will approve this now, but we should probably not include changes of other things in PRs that are unrelated.

from gradio_rangeslider import RangeSlider

import mteb
Expand Down
4 changes: 2 additions & 2 deletions mteb/load_results/benchmark_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import defaultdict
from collections.abc import Iterable
from pathlib import Path
from typing import Any, Callable, Literal, Optional
from typing import Any, Callable, Literal

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -229,7 +229,7 @@ def filter_models(
return type(self).model_construct(model_results=new_model_results)

def join_revisions(self):
def parse_version(version_str: str) -> Optional[Version]:
def parse_version(version_str: str) -> Version | None:
try:
return Version(version_str)
except (InvalidVersion, TypeError):
Expand Down
3 changes: 1 addition & 2 deletions mteb/models/cohere_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def encode(
cohere_eng_3 = ModelMeta(
loader=partial(
CohereTextEmbeddingModel,
model_name="embed-multilingual-v3.0",
model_name="embed-english-v3.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, thanks for fixing it

model_prompts=model_prompts,
),
name="Cohere/Cohere-embed-english-v3.0",
Expand All @@ -229,7 +229,6 @@ def encode(
use_instructions=False,
)


cohere_mult_light_3 = ModelMeta(
loader=partial(
CohereTextEmbeddingModel,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ ignore = ["E501", # line too long
"D107", # Missing docstring in __init__
"D205", # 1 blank line required between summary line and description
"D415", # First line should end with a period
"C408", # don't use unecc. collection call, e.g. dict over {}
]

[tool.ruff.lint.flake8-implicit-str-concat]
Expand Down
Loading