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

[🐛BUG] old data format read failed #1841

Open
panhaoyu opened this issue Aug 23, 2023 · 1 comment
Open

[🐛BUG] old data format read failed #1841

panhaoyu opened this issue Aug 23, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@panhaoyu
Copy link

panhaoyu commented Aug 23, 2023

please check the issue1740.

hello, could you please recheck the issue? seems the issue still exists in 1.1.1

It seems that the code in the repo have fixed the bug, but the pypi package still remain the wrong code. Could you please update the package?

And the code in the current repo still cannot fix the problem for yelp-2022.

Here's my monkey patch, which is only tested for yelp-2022.

def rename_atomic_files(folder, old_name, new_name):
    """Rename all atomic files in a given folder.

    Args:
        folder (string): The folder.
        old_name (string): Old name for atomic files.
        new_name (string): New name for atomic files.
    """
    sub_files = os.listdir(folder)
    sub_files = [f for f in sub_files if f not in ('.DS_Store',)]
    if len(sub_files) == 1:
        sub_dir = os.path.join(folder, sub_files[0])
        if os.path.isdir(sub_dir):
            for sub_file in os.listdir(sub_dir):
                shutil.move(os.path.join(sub_dir, sub_file), os.path.join(folder, sub_file))
            os.rmdir(sub_dir)
    for file in os.listdir(folder):
        base, suf = os.path.splitext(file)
        if old_name not in base:
            continue
        if suf not in {".inter", ".user", ".item"}:
            logger = getLogger()
            logger.warning(f"Moving downloaded file with suffix [{suf}].")
        os.rename(
            os.path.join(folder, file),
            os.path.join(folder, base.replace(old_name, new_name) + suf),
        )


recbole.data.dataset.dataset.rename_atomic_files = rename_atomic_files
@panhaoyu panhaoyu added the bug Something isn't working label Aug 23, 2023
@Sherry-XLL Sherry-XLL self-assigned this Aug 24, 2023
@Sherry-XLL
Copy link
Member

Hello @panhaoyu, thanks for your suggestions and contributions! We will review your code and fix the bug in time. Thanks again for your continued attention and feedback to RecBole!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants