Skip to content

Commit

Permalink
Add cohere models (#1538)
Browse files Browse the repository at this point in the history
* fix: bug cohere names

* format
  • Loading branch information
KennethEnevoldsen authored Dec 4, 2024
1 parent ac4a706 commit c2f4c26
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
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
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",
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

0 comments on commit c2f4c26

Please sign in to comment.