Skip to content

Commit

Permalink
Added speed estimates
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jul 18, 2024
1 parent 8f523f1 commit 74323ee
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/seb/cache/BAAI__bge-m3/Speed_(CPU).json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"task_name":"Speed (CPU)","task_description":"Time taken to encode the text 'The Ugly Duckling' split by paragraphs on a CPU.","task_version":"0.0.1","time_of_run":"2024-07-18T22:16:33.346519","scores":{"da":{"Inference speed (seconds)":12.632516384124756,"words pr. second":284.26640352612554,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"nb":{"Inference speed (seconds)":12.632516384124756,"words pr. second":284.26640352612554,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"nn":{"Inference speed (seconds)":12.632516384124756,"words pr. second":284.26640352612554,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"sv":{"Inference speed (seconds)":12.632516384124756,"words pr. second":284.26640352612554,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"da-bornholm":{"Inference speed (seconds)":12.632516384124756,"words pr. second":284.26640352612554,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"is":{"Inference speed (seconds)":12.632516384124756,"words pr. second":284.26640352612554,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"fo":{"Inference speed (seconds)":12.632516384124756,"words pr. second":284.26640352612554,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0}},"main_score":"Inference speed (seconds)"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"task_name":"Speed (CPU)","task_description":"Time taken to encode the text 'The Ugly Duckling' split by paragraphs on a CPU.","task_version":"0.0.1","time_of_run":"2024-07-18T22:15:48.257131","scores":{"da":{"Inference speed (seconds)":8.318177938461304,"words pr. second":431.70511938630915,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"nb":{"Inference speed (seconds)":8.318177938461304,"words pr. second":431.70511938630915,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"nn":{"Inference speed (seconds)":8.318177938461304,"words pr. second":431.70511938630915,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"sv":{"Inference speed (seconds)":8.318177938461304,"words pr. second":431.70511938630915,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"da-bornholm":{"Inference speed (seconds)":8.318177938461304,"words pr. second":431.70511938630915,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"is":{"Inference speed (seconds)":8.318177938461304,"words pr. second":431.70511938630915,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"fo":{"Inference speed (seconds)":8.318177938461304,"words pr. second":431.70511938630915,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0}},"main_score":"Inference speed (seconds)"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"task_name":"Speed (CPU)","task_description":"Time taken to encode the text 'The Ugly Duckling' split by paragraphs on a CPU.","task_version":"0.0.1","time_of_run":"2024-07-18T22:16:04.378443","scores":{"da":{"Inference speed (seconds)":1.32667875289917,"words pr. second":2706.75926041074,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"nb":{"Inference speed (seconds)":1.32667875289917,"words pr. second":2706.75926041074,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"nn":{"Inference speed (seconds)":1.32667875289917,"words pr. second":2706.75926041074,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"sv":{"Inference speed (seconds)":1.32667875289917,"words pr. second":2706.75926041074,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"da-bornholm":{"Inference speed (seconds)":1.32667875289917,"words pr. second":2706.75926041074,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"is":{"Inference speed (seconds)":1.32667875289917,"words pr. second":2706.75926041074,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0},"fo":{"Inference speed (seconds)":1.32667875289917,"words pr. second":2706.75926041074,"platform":"Linux","platform-release":"5.4.256.el8","platform-version":"#1 SMP Fri Sep 15 11:14:00 CEST 2023","architecture":"x86_64","processor":"x86_64","ram":"377 GB","Physical cores":32.0,"Total cores":64.0}},"main_score":"Inference speed (seconds)"}
1 change: 1 addition & 0 deletions src/seb/registered_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from .openai_models import *
from .translate_e5_models import *
from .voyage_models import *
from .bge_models import *
14 changes: 9 additions & 5 deletions src/seb/registered_models/bge_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def encode( # type: ignore
if "task" in kwargs:
kwargs.pop("task")

return np.asarray(self.mdl.encode(sentences, batch_size=batch_size, **kwargs))
if "convert_to_tensor" in kwargs:
kwargs.pop("convert_to_tensor")

return np.asarray(self.mdl.encode(sentences, batch_size=batch_size, convert_to_numpy=True, **kwargs))

def encode_queries(self, queries: list[str], batch_size: int = 32, **kwargs: Any) -> np.ndarray:
if "task" in kwargs:
Expand All @@ -48,6 +51,7 @@ def encode_corpus(
batch_size: int = 32,
**kwargs: Any,
) -> np.ndarray:
batch_size = 1
if "task" in kwargs:
kwargs.pop("task")
if isinstance(corpus, dict):
Expand All @@ -61,17 +65,17 @@ def encode_corpus(
return emb # type: ignore


@models.register("BAAI/bge-m3")
@models.register("bge-m3")
def create_bge_m3() -> SebModel:
hf_name = "BAAI/bge-m3"
meta = ModelMeta(
name=hf_name,
name="bge-m3",
huggingface_name=hf_name,
reference=f"https://huggingface.co/{hf_name}",
languages=[],
open_source=False,
open_source=True,
embedding_size=1024,
architecture="API",
architecture="XLM-R",
release_date=date(2024, 5, 28),
)
return SebModel(
Expand Down

0 comments on commit 74323ee

Please sign in to comment.