Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0bffbcc
Adding JapaneseCode1Retrieval as the first non-public dataset
fzoll Sep 10, 2025
da4fcad
Transformed dataset
fzoll Sep 10, 2025
e196663
Adding as private dataset to tests
fzoll Sep 10, 2025
f0807c3
Correct the private task test
fzoll Sep 10, 2025
ef047d3
Use the sample dataset as a reference
fzoll Sep 11, 2025
2f48f66
Use the sample dataset as a reference
fzoll Sep 11, 2025
8456668
fix ds loading
Samoed Sep 11, 2025
53476f6
allow on forks
Samoed Sep 11, 2025
cb655a5
upd aciton
Samoed Sep 11, 2025
08d7c87
remove paths
Samoed Sep 11, 2025
10eea6a
try to trigger ci
Samoed Sep 11, 2025
c6aded6
add ref
Samoed Sep 11, 2025
1242651
add permissions
Samoed Sep 11, 2025
db30e8a
remove paths
Samoed Sep 11, 2025
d1e4553
add paths back
Samoed Sep 12, 2025
7a9167d
get back to pull request
Samoed Sep 12, 2025
0582b65
rollback action
Samoed Sep 12, 2025
b297b78
Trying to resolve the token/secret problem
fzoll Sep 12, 2025
2224ed5
Trying to resolve the token/secret problem
fzoll Sep 12, 2025
3364b46
Update dataset_loading_pr.yml
Samoed Sep 12, 2025
669a24f
Update dataset_loading_pr.yml
Samoed Sep 12, 2025
d53e9a0
Try the latest datasets package (worked for me)
fzoll Sep 13, 2025
2e1d0a0
Try the latest datasets package (worked for me)
fzoll Sep 13, 2025
ff54120
Try the latest datasets package (worked for me)
fzoll Sep 13, 2025
4ebc3b3
(last?) try
fzoll Sep 13, 2025
efbf197
(last?) try
fzoll Sep 13, 2025
e556410
(last?) try
fzoll Sep 13, 2025
bea2d52
Reverting the changes
fzoll Sep 13, 2025
87a831a
Exclude the private datasets from tests
fzoll Sep 15, 2025
ace36e3
Merge branch 'embeddings-benchmark:main' into adding_the_first_closed…
fzoll Sep 16, 2025
ac6eab7
Apply suggestions from code review
KennethEnevoldsen Sep 16, 2025
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
6 changes: 6 additions & 0 deletions .github/workflows/dataset_loading.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jobs:
run: |
make install-for-tests

- name: HF auth
env:
HF_TOKEN: ${{ secrets.MTEB_PRIVATE }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After some discussion with @fzoll, I think it is better to ignore the private datasets in the test.

There are a couple of reasons:

  • This does not seem to be working, and @fzoll suggested that this might be due to GitHub-based token protection to prevent leaking a token. Not entirely sure if it is the case though, couldn't find a source on it.
  • If there is issue, it will only be us that have to deal with it so by not testing this we will not expose any issues other to the users
  • It makes it possible to run all tests locally without having to have a token, thus making it easier for contributors.

Comment thread
fzoll marked this conversation as resolved.
Outdated
Comment thread
KennethEnevoldsen marked this conversation as resolved.
Outdated
run: |
hf auth login --token $HF_TOKEN

- name: Run dataset loading tests
run: |
make dataset-load-test
19 changes: 17 additions & 2 deletions .github/workflows/dataset_loading_pr.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
name: Datasets available on HuggingFace - PR

on:
pull_request:
pull_request_target:
types: [opened, synchronize, edited]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Still not seeing this workflow being run. I think these 3 lines should be reverted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I reverted them, but wihtout these lines token from fork will be used, but it not exist there

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh I see.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know how to make this action working with pr's from forks. Maybe we can ignore private dataset in action that test them in PR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, let's ignore for now and start an issue to ask for help.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we just do a simple test to see that the secret is working? (e.g. create a specific CI which loads this private dataset

python -c "import datasets; ds = load_dataset(...); print("dataset loaded")"

@Samoed Samoed Sep 13, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried and only passing token directly to load_dataset worked. hf auth login or python login didn't work

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So probably better off skipping private ones in the existing test, and write a separate one for private datasets then eh

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@isaac-chung @Samoed I can exclude the private datasets from this test...but how to test the private datasets?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

only passing token directly to load_dataset worked

write a separate one for private datasets

paths:
- "mteb/tasks/**.py"
Comment thread
Samoed marked this conversation as resolved.

permissions:
contents: read
pull-requests: read


jobs:
run-pr-datasets-loading-check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: Checkout code
uses: actions/checkout@v4
with:
# IMPORTANT: For pull_request_target, check out the PR branch explicitly
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -23,6 +32,12 @@ jobs:
run: |
make install-for-tests

- name: HF auth
env:
HF_TOKEN: ${{ secrets.MTEB_PRIVATE }}
Comment thread
fzoll marked this conversation as resolved.
Outdated
Comment thread
KennethEnevoldsen marked this conversation as resolved.
Outdated
run: |
hf auth login --token $HF_TOKEN

- name: Run dataset loading tests
run: |
make dataset-load-test-pr BASE_BRANCH=${{ github.event.pull_request.base.ref }}
1 change: 1 addition & 0 deletions mteb/tasks/Retrieval/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .code.DS1000Retrieval import *
from .code.FreshStackRetrieval import *
from .code.HumanEvalRetrieval import *
from .code.JapaneseCode1Retrieval import *
from .code.MBPPRetrieval import *
from .code.StackOverflowQARetrieval import *
from .code.SyntheticText2SqlRetrieval import *
Expand Down
31 changes: 31 additions & 0 deletions mteb/tasks/Retrieval/code/JapaneseCode1Retrieval.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from __future__ import annotations

from mteb.abstasks.AbsTaskRetrieval import AbsTaskRetrieval
from mteb.abstasks.TaskMetadata import TaskMetadata


class JapaneseCode1Retrieval(AbsTaskRetrieval):
metadata = TaskMetadata(
name="JapaneseCode1Retrieval",
description="Japanese code retrieval dataset. Japanese natural language queries paired with Python code snippets for cross-lingual code retrieval evaluation.",
reference="https://huggingface.co/datasets/mteb-private/JapaneseCode1Retrieval-sample",
dataset={
"path": "mteb-private/JapaneseCode1Retrieval",
"revision": "fc4cb6390055e65490dfc42526e1d6a379e8cd86",
},
type="Retrieval",
category="s2p",
modalities=["text"],
eval_splits=["test"],
eval_langs=["jpn-Jpan"],
main_score="ndcg_at_10",
date=("2024-01-01", "2024-01-01"),
domains=["Programming", "Written"],
task_subtypes=["Code retrieval"],
license="not specified",
annotations_creators="derived",
dialect=[],
sample_creation="found",
bibtex_citation="",
is_public=False,
)
3 changes: 2 additions & 1 deletion tests/test_tasks/test_private_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# List of accepted private tasks - update this list as needed
ACCEPTED_PRIVATE_TASKS = [
"JapaneseCode1Retrieval",
# Add task names here that are allowed to be private
# Example: "SomePrivateTask"
]
Expand All @@ -31,6 +32,6 @@ def test_private_tasks_fail_unless_accepted():
def test_accepted_private_task_exist(task_name: str):
"""Test that all tasks in ACCEPTED_PRIVATE_TASKS actually exist and are private."""
task = get_task(task_name)
assert task.metadata.is_public == (
assert task.metadata.is_public is False, (
f"Task '{task_name}' is in ACCEPTED_PRIVATE_TASKS but is not private (is_public={task.metadata.is_public})"
)
Loading