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

ValueError: invalid literal for int() with base 10: 'caches.json' #9

Open
yonikremer opened this issue Mar 8, 2023 · 1 comment
Open

Comments

@yonikremer
Copy link

yonikremer commented Mar 8, 2023

I get the following error when caching to disk:

test_models_support.py:9: in <module>
    from src.grouped_sampling.config import get_config
../src/grouped_sampling/__init__.py:1: in <module>
    from .base_pipeline import GroupedGenerationPipeLine
../src/grouped_sampling/base_pipeline.py:17: in <module>
    from .tokenizer import get_end_of_text_id, get_padding_id, get_tokenizer
../src/grouped_sampling/tokenizer.py:139: in <module>
    def get_tokenizer_name(
../../../miniconda3/envs/grouped_sampling/lib/python3.10/site-packages/cache_to_disk/cache_to_disk.py:72: in decorator
    delete_old_disk_caches()
../../../miniconda3/envs/grouped_sampling/lib/python3.10/site-packages/cache_to_disk/cache_to_disk.py:50: in delete_old_disk_caches
    max_age_days = int(file.split('_')[-1].replace('.pkl', ''))
E   ValueError: invalid literal for int() with base 10: 'caches.json'
collected 0 items / 1 error
ERROR: not found: /home/yoni/PycharmProjects/grouped_sampling/tests/test_models_support.py::test_unsupported_tokenizers
(no name '/home/yoni/PycharmProjects/grouped_sampling/tests/test_models_support.py::test_unsupported_tokenizers' in any of [<Module test_models_support.py>])
@yonikremer
Copy link
Author

I solved it:

I changed get_files_in_directory to:

def get_files_in_directory(directory):
    return [
        f for f in os.listdir(directory) if
        isfile(join(directory, f)) and f.endswith('.pkl')
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant