diff --git a/ckpts/universal/global_step20/zero/17.attention.dense.weight/exp_avg_sq.pt b/ckpts/universal/global_step20/zero/17.attention.dense.weight/exp_avg_sq.pt new file mode 100644 index 0000000000000000000000000000000000000000..676b4a46649a6d7c7c1252f4e0ae71badd6f6553 --- /dev/null +++ b/ckpts/universal/global_step20/zero/17.attention.dense.weight/exp_avg_sq.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f021d74a5b25e9ff0cb791f7da8aaa46090ab7722b8e7f524a3b9bb0b5ad8b54 +size 16778411 diff --git a/lm-evaluation-harness/tests/testdata/gpt3_test_0deb8e9bde8e8327bbc48157f638ff3ba06b0cd816dad2beb8ad90f7fbe795c7.pkl b/lm-evaluation-harness/tests/testdata/gpt3_test_0deb8e9bde8e8327bbc48157f638ff3ba06b0cd816dad2beb8ad90f7fbe795c7.pkl new file mode 100644 index 0000000000000000000000000000000000000000..674d4b4cf12b369e32a36d570dc3310218e0ccf2 --- /dev/null +++ b/lm-evaluation-harness/tests/testdata/gpt3_test_0deb8e9bde8e8327bbc48157f638ff3ba06b0cd816dad2beb8ad90f7fbe795c7.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f7a190d338d1ef03f209a8a3340c0d282c73723633b8f5a71a8dc8ee94b9535 +size 570 diff --git a/lm-evaluation-harness/tests/testdata/gpt3_test_bb2cc49115e88788ed870ad0716eb00b280a885f91c7ed6e1e864435e5e2b6ac.pkl b/lm-evaluation-harness/tests/testdata/gpt3_test_bb2cc49115e88788ed870ad0716eb00b280a885f91c7ed6e1e864435e5e2b6ac.pkl new file mode 100644 index 0000000000000000000000000000000000000000..657a1621f425215826e84cbc025ce12554480a6e --- /dev/null +++ b/lm-evaluation-harness/tests/testdata/gpt3_test_bb2cc49115e88788ed870ad0716eb00b280a885f91c7ed6e1e864435e5e2b6ac.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad18c6203e8b3eda1b88f8dfd7d197c4053c07640b0542fcdd8170e9b3bd2d30 +size 2479 diff --git a/lm-evaluation-harness/tests/testdata/gpt3_test_cfd11f555a5a63b6dfa114a55a932e51b724cdd44d4842586b9ce37260bf7aaa.pkl b/lm-evaluation-harness/tests/testdata/gpt3_test_cfd11f555a5a63b6dfa114a55a932e51b724cdd44d4842586b9ce37260bf7aaa.pkl new file mode 100644 index 0000000000000000000000000000000000000000..f27281ef4ea5c0438cbc9bff8ffdbc40a2c847f8 --- /dev/null +++ b/lm-evaluation-harness/tests/testdata/gpt3_test_cfd11f555a5a63b6dfa114a55a932e51b724cdd44d4842586b9ce37260bf7aaa.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d531b0854314516cad7d56c7e28a694bf23072429147b235e9c6534492867bb2 +size 2984 diff --git a/lm-evaluation-harness/tests/testdata/textsynth_test_51b5302f157cf224f694ccad973f255ae19e9e061d533256bdf75b04e0a917ab.pkl b/lm-evaluation-harness/tests/testdata/textsynth_test_51b5302f157cf224f694ccad973f255ae19e9e061d533256bdf75b04e0a917ab.pkl new file mode 100644 index 0000000000000000000000000000000000000000..622dc4ebf4fa281171d3cd9b5f6437401c8b8cfc --- /dev/null +++ b/lm-evaluation-harness/tests/testdata/textsynth_test_51b5302f157cf224f694ccad973f255ae19e9e061d533256bdf75b04e0a917ab.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22cb4aaeb7f974ef2dc2ae63572f8936710e39ba48b4f08f5fd37b201dec6148 +size 1766 diff --git a/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/config.yaml b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5c1ac4e49694bcc5d68ae5be2d5f70da2044a198 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/config.yaml @@ -0,0 +1,43 @@ +wandb_version: 1 + +_wandb: + desc: null + value: + python_version: 3.10.12 + cli_version: 0.17.0 + framework: huggingface + huggingface_version: 4.40.2 + is_jupyter_run: false + is_kaggle_kernel: false + start_time: 1715686900 + t: + 1: + - 1 + - 5 + - 11 + - 49 + - 51 + - 53 + - 55 + - 71 + - 98 + - 100 + 2: + - 1 + - 5 + - 11 + - 49 + - 51 + - 53 + - 55 + - 71 + - 98 + - 100 + 3: + - 23 + 4: 3.10.12 + 5: 0.17.0 + 6: 4.40.2 + 8: + - 5 + 13: linux-x86_64 diff --git a/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log new file mode 100644 index 0000000000000000000000000000000000000000..babc033ac6c9feafa9aef884fa8e88c047db9166 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log @@ -0,0 +1,28 @@ + +2024-05-14:11:41:40,823 INFO [__main__.py:251] Verbosity set to INFO +2024-05-14:11:41:46,727 INFO [__main__.py:335] Selected Tasks: ['indiccopa-hi'] +2024-05-14:11:41:46,732 INFO [evaluator.py:131] Setting random seed to 0 | Setting numpy seed to 1234 | Setting torch manual seed to 1234 +2024-05-14:11:41:46,733 INFO [evaluator.py:177] Initializing hf model, with arguments: {'pretrained': '/data/cronscript/ckpts//hf_ckpt//global_step100'} +/usr/local/lib/python3.10/dist-packages/habana_frameworks/torch/gpu_migration/core/register.py:145: UserWarning: "hpu:X" notation is not supported by Gaudi PyTorch intergration bridge. Please change to "hpu" without index (Triggered internally at /npu-stack/pytorch-integration/pytorch_helpers/lazy_to_backend.cpp:53.) + return func(*args, **kwargs) +/usr/local/lib/python3.10/dist-packages/habana_frameworks/torch/gpu_migration/torch/cuda/memory.py:36: UserWarning: No need to call empty_cache on HPU. It manages the memory internally in an effcient way. + warnings.warn( +/usr/local/lib/python3.10/dist-packages/habana_frameworks/torch/hpu/__init__.py:158: UserWarning: torch.hpu.setDeterministic is deprecated and will be removed in next release. Please use torch.use_deterministic_algorithms instead. + warnings.warn( +You are using the default legacy behaviour of the . This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565 +2024-05-14:11:41:58,864 WARNING [task.py:763] [Task: indiccopa-hi] metric acc is defined, but aggregation is not. using default aggregation=mean +2024-05-14:11:41:58,864 WARNING [task.py:775] [Task: indiccopa-hi] metric acc is defined, but higher_is_better is not. using default higher_is_better=True +[2024-05-14 11:41:58,485] [INFO] [real_accelerator.py:178:get_accelerator] Setting ds_accelerator to hpu (auto detect) +/usr/local/lib/python3.10/dist-packages/datasets/load.py:1486: FutureWarning: The repository for ai4bharat/IndicCOPA contains custom code which must be executed to correctly load the dataset. You can inspect the repository content at https://hf.co/datasets/ai4bharat/IndicCOPA +You can avoid this message in future by passing the argument `trust_remote_code=True`. +Passing `trust_remote_code=True` will be mandatory to load this dataset from the next major release of `datasets`. + warnings.warn( +2024-05-14:11:42:00,053 WARNING [task.py:322] [Task: indiccopa-hi] has_training_docs and has_validation_docs are False, using test_docs as fewshot_docs but this is not recommended. +2024-05-14:11:42:00,053 WARNING [task.py:322] [Task: indiccopa-hi] has_training_docs and has_validation_docs are False, using test_docs as fewshot_docs but this is not recommended. +2024-05-14:11:42:00,072 INFO [task.py:395] Building contexts for indiccopa-hi on rank 3... +100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 56/56 [00:00<00:00, 108540.21it/s] +Passed argument batch_size = auto:1. Detecting largest batch size +2024-05-14:11:42:01,857 INFO [evaluator.py:379] Running loglikelihood requests +/usr/local/lib/python3.10/dist-packages/habana_frameworks/torch/gpu_migration/torch/cuda/memory.py:36: UserWarning: No need to call empty_cache on HPU. It manages the memory internally in an effcient way. + warnings.warn( +Determined largest batch size: 64 \ No newline at end of file diff --git a/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/requirements.txt b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..d63edd781bd5bdbb7f67523ac1ba9f0f1ed392dc --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/requirements.txt @@ -0,0 +1,163 @@ +DataProperty==1.0.1 +GitPython==3.1.43 +Jinja2==3.1.3 +Markdown==3.6 +MarkupSafe==2.1.5 +Pillow-SIMD==7.0.0.post3 +PyYAML==6.0 +Werkzeug==3.0.2 +absl-py==2.1.0 +accelerate==0.30.1 +aiohttp==3.9.4 +aiosignal==1.3.1 +antlr4-python3-runtime==4.9.3 +anyio==4.3.0 +async-timeout==4.0.3 +attrs==23.2.0 +av==9.2.0 +cachetools==5.3.3 +certifi==2024.2.2 +cffi==1.15.1 +cfgv==3.4.0 +chardet==5.2.0 +charset-normalizer==3.3.2 +click==8.1.7 +cmake==3.29.2 +colorama==0.4.6 +datasets==2.19.1 +deepspeed==0.12.4+hpu.synapse.v1.15.1 +dill==0.3.8 +distlib==0.3.8 +distro==1.9.0 +docker-pycreds==0.4.0 +einops==0.8.0 +evaluate==0.4.2 +exceptiongroup==1.2.0 +expecttest==0.2.1 +filelock==3.13.4 +frozenlist==1.4.1 +fsspec==2024.3.1 +gitdb==4.0.11 +google-auth-oauthlib==0.4.6 +google-auth==2.29.0 +grpcio==1.62.1 +h11==0.14.0 +habana-media-loader==1.15.1.15 +habana-pyhlml==1.15.1.15 +habana-torch-dataloader==1.15.1.15 +habana-torch-plugin==1.15.1.15 +habana_gpu_migration==1.15.1.15 +habana_quantization_toolkit==1.15.1.15 +hjson==3.1.0 +httpcore==1.0.5 +httpx==0.27.0 +huggingface-hub==0.23.0 +identify==2.5.35 +idna==3.7 +importlib_resources==6.4.0 +iniconfig==2.0.0 +joblib==1.4.2 +jsonlines==4.0.0 +lightning-habana==1.4.0 +lightning-utilities==0.11.2 +lightning==2.2.0.post0 +lm_eval==0.3.0 +lm_eval==0.4.2 +lm_eval==0.4.2 +lm_eval==0.4.2 +mbstrdecoder==1.1.3 +more-itertools==10.2.0 +mpi4py==3.1.4 +mpmath==1.3.0 +multidict==6.0.5 +multiprocess==0.70.16 +networkx==3.3 +ninja==1.11.1.1 +nltk==3.8.1 +nodeenv==1.8.0 +numexpr==2.10.0 +numpy==1.23.5 +oauthlib==3.2.2 +omegaconf==2.3.0 +openai==1.29.0 +packaging==24.0 +pandas==2.0.1 +pathspec==0.12.1 +pathvalidate==3.2.0 +peft==0.10.0 +perfetto==0.7.0 +pip==22.0.2 +pip==23.3.1 +platformdirs==4.2.0 +pluggy==1.4.0 +portalocker==2.8.2 +pre-commit==3.3.3 +protobuf==3.20.3 +psutil==5.9.8 +py-cpuinfo==9.0.0 +pyarrow-hotfix==0.6 +pyarrow==16.0.0 +pyasn1==0.6.0 +pyasn1_modules==0.4.0 +pybind11==2.10.4 +pycountry==23.12.11 +pycparser==2.22 +pydantic==1.10.13 +pynvml==8.0.4 +pytablewriter==1.2.0 +pytest==8.1.1 +python-dateutil==2.9.0.post0 +pytorch-lightning==2.2.2 +pytz==2024.1 +regex==2023.5.5 +requests-oauthlib==2.0.0 +requests==2.31.0 +rouge_score==0.1.2 +rsa==4.9 +sacrebleu==1.5.0 +safetensors==0.4.3 +scikit-learn==1.4.2 +scipy==1.13.0 +sentencepiece==0.2.0 +sentry-sdk==2.1.1 +setproctitle==1.3.3 +setuptools==59.6.0 +setuptools==69.5.1 +six==1.16.0 +smmap==5.0.1 +sniffio==1.3.1 +sqlitedict==2.1.0 +symengine==0.11.0 +sympy==1.12 +tabledata==1.3.3 +tcolorpy==0.1.6 +tdqm==0.0.1 +tensorboard-data-server==0.6.1 +tensorboard-plugin-wit==1.8.1 +tensorboard==2.11.2 +threadpoolctl==3.5.0 +tokenizers==0.19.1 +tomli==2.0.1 +torch==2.2.0a0+git8964477 +torch_tb_profiler==0.4.0 +torchaudio==2.2.0+08901ad +torchdata==0.7.1+5e6f7b7 +torchmetrics==1.3.2 +torchtext==0.17.0+400da5c +torchvision==0.17.0+b2383d4 +tqdm-multiprocess==0.0.11 +tqdm==4.66.2 +transformers==4.40.2 +typepy==1.3.2 +typing_extensions==4.11.0 +tzdata==2024.1 +urllib3==1.26.18 +virtualenv==20.25.1 +wandb==0.17.0 +wheel==0.37.1 +wheel==0.43.0 +word2number==1.1 +xxhash==3.4.1 +yamllint==1.35.1 +yarl==1.9.4 +zstandard==0.22.0 \ No newline at end of file diff --git a/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-metadata.json b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..833bb69dec4ff407853b77252695ad02a66c01a8 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-metadata.json @@ -0,0 +1,810 @@ +{ + "os": "Linux-5.15.0-92-generic-x86_64-with-glibc2.35", + "python": "3.10.12", + "heartbeatAt": "2024-05-14T11:41:40.690204", + "startedAt": "2024-05-14T11:41:40.258007", + "docker": null, + "cuda": null, + "args": [ + "--model", + "hf", + "--model_args", + "pretrained=/data/cronscript/ckpts//hf_ckpt//global_step100", + "--tasks", + "indiccopa-hi", + "--batch_size", + "auto", + "--wandb_args", + "project=bharatgpt,group=global_step100" + ], + "state": "running", + "program": "-m lm_eval.__main__", + "codePathLocal": null, + "git": { + "remote": "https://github.com/EleutherAI/lm-evaluation-harness", + "commit": null + }, + "email": null, + "root": "/data/cronscript/lm-evaluation-harness", + "host": "vizzhy-150-3", + "username": "root", + "executable": "/usr/bin/python3", + "cpu_count": 76, + "cpu_count_logical": 152, + "cpu_freq": { + "current": 3388.7512565789475, + "min": 800.0, + "max": 3400.0 + }, + "cpu_freq_per_core": [ + { + "current": 3224.073, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3224.072, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3228.66, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3224.071, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3235.82, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.003, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3230.036, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3227.055, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + } + ], + "disk": { + "/": { + "total": 866.4415092468262, + "used": 77.68970108032227 + } + }, + "memory": { + "total": 1007.5000267028809 + } +} diff --git a/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-summary.json b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-summary.json new file mode 100644 index 0000000000000000000000000000000000000000..4841bc4504e219db83b702d09e68cfaa8fa95063 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-summary.json @@ -0,0 +1 @@ +{"_wandb": {"runtime": 28}} \ No newline at end of file diff --git a/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/logs/debug-internal.log b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/logs/debug-internal.log new file mode 100644 index 0000000000000000000000000000000000000000..599a4bec7e8a2318bf43a48192282f09931ddd7d --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/logs/debug-internal.log @@ -0,0 +1,193 @@ +2024-05-14 11:41:40,274 INFO StreamThr :72086 [internal.py:wandb_internal():85] W&B internal server running at pid: 72086, started at: 2024-05-14 11:41:40.274295 +2024-05-14 11:41:40,276 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: status +2024-05-14 11:41:40,278 INFO WriterThread:72086 [datastore.py:open_for_write():87] open: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/run-3myl7vfa.wandb +2024-05-14 11:41:40,278 DEBUG SenderThread:72086 [sender.py:send():378] send: header +2024-05-14 11:41:40,289 DEBUG SenderThread:72086 [sender.py:send():378] send: run +2024-05-14 11:41:40,516 INFO SenderThread:72086 [dir_watcher.py:__init__():211] watching files in: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files +2024-05-14 11:41:40,516 INFO SenderThread:72086 [sender.py:_start_run_threads():1123] run started: 3myl7vfa with start time 1715686900.274032 +2024-05-14 11:41:40,528 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: check_version +2024-05-14 11:41:40,529 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: check_version +2024-05-14 11:41:40,622 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: run_start +2024-05-14 11:41:40,623 DEBUG HandlerThread:72086 [system_info.py:__init__():26] System info init +2024-05-14 11:41:40,623 DEBUG HandlerThread:72086 [system_info.py:__init__():41] System info init done +2024-05-14 11:41:40,623 INFO HandlerThread:72086 [system_monitor.py:start():194] Starting system monitor +2024-05-14 11:41:40,624 INFO SystemMonitor:72086 [system_monitor.py:_start():158] Starting system asset monitoring threads +2024-05-14 11:41:40,624 INFO HandlerThread:72086 [system_monitor.py:probe():214] Collecting system info +2024-05-14 11:41:40,624 INFO SystemMonitor:72086 [interfaces.py:start():188] Started cpu monitoring +2024-05-14 11:41:40,625 INFO SystemMonitor:72086 [interfaces.py:start():188] Started disk monitoring +2024-05-14 11:41:40,625 INFO SystemMonitor:72086 [interfaces.py:start():188] Started memory monitoring +2024-05-14 11:41:40,626 INFO SystemMonitor:72086 [interfaces.py:start():188] Started network monitoring +2024-05-14 11:41:40,690 DEBUG HandlerThread:72086 [system_info.py:probe():150] Probing system +2024-05-14 11:41:40,698 DEBUG HandlerThread:72086 [system_info.py:_probe_git():135] Probing git +2024-05-14 11:41:40,717 ERROR HandlerThread:72086 [gitlib.py:root():92] git root error: Cmd('git') failed due to: exit code(128) + cmdline: git rev-parse --show-toplevel + stderr: 'fatal: detected dubious ownership in repository at '/data/cronscript/lm-evaluation-harness' +To add an exception for this directory, call: + + git config --global --add safe.directory /data/cronscript/lm-evaluation-harness' +2024-05-14 11:41:40,717 DEBUG HandlerThread:72086 [system_info.py:_probe_git():143] Probing git done +2024-05-14 11:41:40,717 DEBUG HandlerThread:72086 [system_info.py:probe():198] Probing system done +2024-05-14 11:41:40,717 DEBUG HandlerThread:72086 [system_monitor.py:probe():223] {'os': 'Linux-5.15.0-92-generic-x86_64-with-glibc2.35', 'python': '3.10.12', 'heartbeatAt': '2024-05-14T11:41:40.690204', 'startedAt': '2024-05-14T11:41:40.258007', 'docker': None, 'cuda': None, 'args': ('--model', 'hf', '--model_args', 'pretrained=/data/cronscript/ckpts//hf_ckpt//global_step100', '--tasks', 'indiccopa-hi', '--batch_size', 'auto', '--wandb_args', 'project=bharatgpt,group=global_step100'), 'state': 'running', 'program': '-m lm_eval.__main__', 'codePathLocal': None, 'git': {'remote': 'https://github.com/EleutherAI/lm-evaluation-harness', 'commit': None}, 'email': None, 'root': '/data/cronscript/lm-evaluation-harness', 'host': 'vizzhy-150-3', 'username': 'root', 'executable': '/usr/bin/python3', 'cpu_count': 76, 'cpu_count_logical': 152, 'cpu_freq': {'current': 3388.7512565789475, 'min': 800.0, 'max': 3400.0}, 'cpu_freq_per_core': [{'current': 3224.073, 'min': 800.0, 'max': 3400.0}, {'current': 3224.072, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3228.66, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3224.071, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3235.82, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.003, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3230.036, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3227.055, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}], 'disk': {'/': {'total': 866.4415092468262, 'used': 77.68970108032227}}, 'memory': {'total': 1007.5000267028809}} +2024-05-14 11:41:40,718 INFO HandlerThread:72086 [system_monitor.py:probe():224] Finished collecting system info +2024-05-14 11:41:40,718 INFO HandlerThread:72086 [system_monitor.py:probe():227] Publishing system info +2024-05-14 11:41:40,719 INFO HandlerThread:72086 [system_monitor.py:probe():229] Finished publishing system info +2024-05-14 11:41:40,723 DEBUG SenderThread:72086 [sender.py:send():378] send: files +2024-05-14 11:41:40,723 INFO SenderThread:72086 [sender.py:_save_file():1389] saving file wandb-metadata.json with policy now +2024-05-14 11:41:40,819 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: python_packages +2024-05-14 11:41:40,819 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: python_packages +2024-05-14 11:41:40,820 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: stop_status +2024-05-14 11:41:40,820 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: stop_status +2024-05-14 11:41:40,968 DEBUG SenderThread:72086 [sender.py:send():378] send: telemetry +2024-05-14 11:41:41,278 INFO wandb-upload_0:72086 [upload_job.py:push():130] Uploaded file /tmp/tmprtf76kmqwandb/5teveh42-wandb-metadata.json +2024-05-14 11:41:41,520 INFO Thread-12 :72086 [dir_watcher.py:_on_file_created():271] file/dir created: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:41:41,520 INFO Thread-12 :72086 [dir_watcher.py:_on_file_created():271] file/dir created: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/requirements.txt +2024-05-14 11:41:41,520 INFO Thread-12 :72086 [dir_watcher.py:_on_file_created():271] file/dir created: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-metadata.json +2024-05-14 11:41:43,521 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:41:45,970 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: status_report +2024-05-14 11:41:47,533 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:41:51,734 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: status_report +2024-05-14 11:41:55,561 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:41:55,820 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: stop_status +2024-05-14 11:41:55,821 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: stop_status +2024-05-14 11:41:56,958 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: status_report +2024-05-14 11:41:59,568 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:42:00,569 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:42:01,569 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:42:02,016 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: status_report +2024-05-14 11:42:02,570 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:42:03,571 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:42:04,572 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:42:07,361 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: status_report +2024-05-14 11:42:09,390 DEBUG SenderThread:72086 [sender.py:send():378] send: exit +2024-05-14 11:42:09,390 INFO SenderThread:72086 [sender.py:send_exit():585] handling exit code: 0 +2024-05-14 11:42:09,390 INFO SenderThread:72086 [sender.py:send_exit():587] handling runtime: 28 +2024-05-14 11:42:09,391 INFO SenderThread:72086 [sender.py:_save_file():1389] saving file wandb-summary.json with policy end +2024-05-14 11:42:09,392 INFO SenderThread:72086 [sender.py:send_exit():593] send defer +2024-05-14 11:42:09,392 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:09,392 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 0 +2024-05-14 11:42:09,392 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:09,392 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 0 +2024-05-14 11:42:09,392 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 1 +2024-05-14 11:42:09,392 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:09,392 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 1 +2024-05-14 11:42:09,392 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:09,392 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 1 +2024-05-14 11:42:09,392 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 2 +2024-05-14 11:42:09,392 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:09,392 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 2 +2024-05-14 11:42:09,392 INFO HandlerThread:72086 [system_monitor.py:finish():203] Stopping system monitor +2024-05-14 11:42:09,393 DEBUG SystemMonitor:72086 [system_monitor.py:_start():172] Starting system metrics aggregation loop +2024-05-14 11:42:09,393 DEBUG SystemMonitor:72086 [system_monitor.py:_start():179] Finished system metrics aggregation loop +2024-05-14 11:42:09,393 DEBUG SystemMonitor:72086 [system_monitor.py:_start():183] Publishing last batch of metrics +2024-05-14 11:42:09,394 INFO HandlerThread:72086 [interfaces.py:finish():200] Joined cpu monitor +2024-05-14 11:42:09,394 INFO HandlerThread:72086 [interfaces.py:finish():200] Joined disk monitor +2024-05-14 11:42:09,394 INFO HandlerThread:72086 [interfaces.py:finish():200] Joined memory monitor +2024-05-14 11:42:09,394 INFO HandlerThread:72086 [interfaces.py:finish():200] Joined network monitor +2024-05-14 11:42:09,394 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:09,394 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 2 +2024-05-14 11:42:09,394 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 3 +2024-05-14 11:42:09,394 DEBUG SenderThread:72086 [sender.py:send():378] send: stats +2024-05-14 11:42:09,394 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:09,394 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 3 +2024-05-14 11:42:09,395 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:09,395 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 3 +2024-05-14 11:42:09,395 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 4 +2024-05-14 11:42:09,395 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:09,395 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 4 +2024-05-14 11:42:09,395 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:09,395 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 4 +2024-05-14 11:42:09,395 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 5 +2024-05-14 11:42:09,395 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:09,395 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 5 +2024-05-14 11:42:09,395 DEBUG SenderThread:72086 [sender.py:send():378] send: summary +2024-05-14 11:42:09,396 INFO SenderThread:72086 [sender.py:_save_file():1389] saving file wandb-summary.json with policy end +2024-05-14 11:42:09,396 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:09,396 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 5 +2024-05-14 11:42:09,396 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 6 +2024-05-14 11:42:09,396 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:09,396 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 6 +2024-05-14 11:42:09,396 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:09,396 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 6 +2024-05-14 11:42:09,399 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: status_report +2024-05-14 11:42:09,504 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 7 +2024-05-14 11:42:09,505 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:09,505 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 7 +2024-05-14 11:42:09,505 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:09,505 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 7 +2024-05-14 11:42:09,576 INFO Thread-12 :72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/config.yaml +2024-05-14 11:42:09,576 INFO Thread-12 :72086 [dir_watcher.py:_on_file_created():271] file/dir created: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-summary.json +2024-05-14 11:42:10,390 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-14 11:42:12,499 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 8 +2024-05-14 11:42:12,499 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: poll_exit +2024-05-14 11:42:12,500 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:12,500 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 8 +2024-05-14 11:42:12,500 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:12,500 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 8 +2024-05-14 11:42:12,500 INFO SenderThread:72086 [job_builder.py:build():432] Attempting to build job artifact +2024-05-14 11:42:12,500 INFO SenderThread:72086 [job_builder.py:_get_source_type():576] no source found +2024-05-14 11:42:12,500 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 9 +2024-05-14 11:42:12,500 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:12,500 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 9 +2024-05-14 11:42:12,501 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:12,501 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 9 +2024-05-14 11:42:12,501 INFO SenderThread:72086 [dir_watcher.py:finish():358] shutting down directory watcher +2024-05-14 11:42:12,577 INFO SenderThread:72086 [dir_watcher.py:_on_file_modified():288] file/dir modified: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:42:12,577 INFO SenderThread:72086 [dir_watcher.py:finish():388] scan: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files +2024-05-14 11:42:12,577 INFO SenderThread:72086 [dir_watcher.py:finish():402] scan save: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-metadata.json wandb-metadata.json +2024-05-14 11:42:12,578 INFO SenderThread:72086 [dir_watcher.py:finish():402] scan save: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log output.log +2024-05-14 11:42:12,578 INFO SenderThread:72086 [dir_watcher.py:finish():402] scan save: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/config.yaml config.yaml +2024-05-14 11:42:12,578 INFO SenderThread:72086 [dir_watcher.py:finish():402] scan save: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-summary.json wandb-summary.json +2024-05-14 11:42:12,578 INFO SenderThread:72086 [dir_watcher.py:finish():402] scan save: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/requirements.txt requirements.txt +2024-05-14 11:42:12,578 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 10 +2024-05-14 11:42:12,578 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:12,578 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 10 +2024-05-14 11:42:12,580 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:12,580 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 10 +2024-05-14 11:42:12,580 INFO SenderThread:72086 [file_pusher.py:finish():169] shutting down file pusher +2024-05-14 11:42:12,821 INFO wandb-upload_0:72086 [upload_job.py:push():130] Uploaded file /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/output.log +2024-05-14 11:42:12,986 INFO wandb-upload_2:72086 [upload_job.py:push():130] Uploaded file /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/wandb-summary.json +2024-05-14 11:42:13,071 INFO wandb-upload_1:72086 [upload_job.py:push():130] Uploaded file /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/config.yaml +2024-05-14 11:42:13,072 INFO wandb-upload_3:72086 [upload_job.py:push():130] Uploaded file /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/files/requirements.txt +2024-05-14 11:42:13,273 INFO Thread-11 (_thread_body):72086 [sender.py:transition_state():613] send defer: 11 +2024-05-14 11:42:13,273 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:13,273 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 11 +2024-05-14 11:42:13,274 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:13,274 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 11 +2024-05-14 11:42:13,274 INFO SenderThread:72086 [file_pusher.py:join():175] waiting for file pusher +2024-05-14 11:42:13,274 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 12 +2024-05-14 11:42:13,274 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:13,274 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 12 +2024-05-14 11:42:13,274 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:13,274 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 12 +2024-05-14 11:42:13,275 INFO SenderThread:72086 [file_stream.py:finish():601] file stream finish called +2024-05-14 11:42:13,360 INFO SenderThread:72086 [file_stream.py:finish():605] file stream finish is done +2024-05-14 11:42:13,360 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 13 +2024-05-14 11:42:13,360 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:13,360 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 13 +2024-05-14 11:42:13,361 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:13,361 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 13 +2024-05-14 11:42:13,361 INFO SenderThread:72086 [sender.py:transition_state():613] send defer: 14 +2024-05-14 11:42:13,361 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: defer +2024-05-14 11:42:13,361 INFO HandlerThread:72086 [handler.py:handle_request_defer():184] handle defer: 14 +2024-05-14 11:42:13,361 DEBUG SenderThread:72086 [sender.py:send():378] send: final +2024-05-14 11:42:13,361 DEBUG SenderThread:72086 [sender.py:send():378] send: footer +2024-05-14 11:42:13,361 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: defer +2024-05-14 11:42:13,361 INFO SenderThread:72086 [sender.py:send_request_defer():609] handle sender defer: 14 +2024-05-14 11:42:13,362 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-14 11:42:13,362 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: poll_exit +2024-05-14 11:42:13,362 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-14 11:42:13,362 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: server_info +2024-05-14 11:42:13,362 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: poll_exit +2024-05-14 11:42:13,363 DEBUG SenderThread:72086 [sender.py:send_request():405] send_request: server_info +2024-05-14 11:42:13,364 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: get_summary +2024-05-14 11:42:13,364 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: sampled_history +2024-05-14 11:42:13,364 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: internal_messages +2024-05-14 11:42:13,426 INFO MainThread:72086 [wandb_run.py:_footer_history_summary_info():3994] rendering history +2024-05-14 11:42:13,426 INFO MainThread:72086 [wandb_run.py:_footer_history_summary_info():4026] rendering summary +2024-05-14 11:42:13,426 INFO MainThread:72086 [wandb_run.py:_footer_sync_info():3953] logging synced files +2024-05-14 11:42:13,426 DEBUG HandlerThread:72086 [handler.py:handle_request():158] handle_request: shutdown +2024-05-14 11:42:13,426 INFO HandlerThread:72086 [handler.py:finish():882] shutting down handler +2024-05-14 11:42:14,363 INFO WriterThread:72086 [datastore.py:close():296] close: /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/run-3myl7vfa.wandb +2024-05-14 11:42:14,425 INFO SenderThread:72086 [sender.py:finish():1545] shutting down sender +2024-05-14 11:42:14,426 INFO SenderThread:72086 [file_pusher.py:finish():169] shutting down file pusher +2024-05-14 11:42:14,426 INFO SenderThread:72086 [file_pusher.py:join():175] waiting for file pusher diff --git a/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/logs/debug.log b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/logs/debug.log new file mode 100644 index 0000000000000000000000000000000000000000..79a405775c50523da3588314cd3cff9c1002b3e1 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/logs/debug.log @@ -0,0 +1,29 @@ +2024-05-14 11:41:40,270 INFO MainThread:70755 [wandb_setup.py:_flush():76] Current SDK version is 0.17.0 +2024-05-14 11:41:40,270 INFO MainThread:70755 [wandb_setup.py:_flush():76] Configure stats pid to 70755 +2024-05-14 11:41:40,270 INFO MainThread:70755 [wandb_setup.py:_flush():76] Loading settings from /root/.config/wandb/settings +2024-05-14 11:41:40,270 INFO MainThread:70755 [wandb_setup.py:_flush():76] Loading settings from /data/cronscript/lm-evaluation-harness/wandb/settings +2024-05-14 11:41:40,270 INFO MainThread:70755 [wandb_setup.py:_flush():76] Loading settings from environment variables: {} +2024-05-14 11:41:40,270 INFO MainThread:70755 [wandb_setup.py:_flush():76] Applying setup settings: {'_disable_service': False} +2024-05-14 11:41:40,271 WARNING MainThread:70755 [wandb_setup.py:_flush():76] Could not find program at -m lm_eval.__main__ +2024-05-14 11:41:40,271 INFO MainThread:70755 [wandb_setup.py:_flush():76] Inferring run settings from compute environment: {'program_relpath': None, 'program': '-m lm_eval.__main__'} +2024-05-14 11:41:40,271 INFO MainThread:70755 [wandb_setup.py:_flush():76] Applying login settings: {} +2024-05-14 11:41:40,271 INFO MainThread:70755 [wandb_init.py:_log_setup():520] Logging user logs to /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/logs/debug.log +2024-05-14 11:41:40,271 INFO MainThread:70755 [wandb_init.py:_log_setup():521] Logging internal logs to /data/cronscript/lm-evaluation-harness/wandb/run-20240514_114140-3myl7vfa/logs/debug-internal.log +2024-05-14 11:41:40,271 INFO MainThread:70755 [wandb_init.py:init():560] calling init triggers +2024-05-14 11:41:40,271 INFO MainThread:70755 [wandb_init.py:init():567] wandb.init called with sweep_config: {} +config: {} +2024-05-14 11:41:40,271 INFO MainThread:70755 [wandb_init.py:init():610] starting backend +2024-05-14 11:41:40,271 INFO MainThread:70755 [wandb_init.py:init():614] setting up manager +2024-05-14 11:41:40,272 INFO MainThread:70755 [backend.py:_multiprocessing_setup():105] multiprocessing start_methods=fork,spawn,forkserver, using: spawn +2024-05-14 11:41:40,273 INFO MainThread:70755 [wandb_init.py:init():622] backend started and connected +2024-05-14 11:41:40,276 INFO MainThread:70755 [wandb_init.py:init():711] updated telemetry +2024-05-14 11:41:40,288 INFO MainThread:70755 [wandb_init.py:init():744] communicating run to backend with 90.0 second timeout +2024-05-14 11:41:40,527 INFO MainThread:70755 [wandb_run.py:_on_init():2396] communicating current version +2024-05-14 11:41:40,612 INFO MainThread:70755 [wandb_run.py:_on_init():2405] got version response +2024-05-14 11:41:40,612 INFO MainThread:70755 [wandb_init.py:init():795] starting run threads in backend +2024-05-14 11:41:40,820 INFO MainThread:70755 [wandb_run.py:_console_start():2374] atexit reg +2024-05-14 11:41:40,820 INFO MainThread:70755 [wandb_run.py:_redirect():2229] redirect: wrap_raw +2024-05-14 11:41:40,820 INFO MainThread:70755 [wandb_run.py:_redirect():2294] Wrapping output streams. +2024-05-14 11:41:40,820 INFO MainThread:70755 [wandb_run.py:_redirect():2319] Redirects installed. +2024-05-14 11:41:40,821 INFO MainThread:70755 [wandb_init.py:init():838] run started, returning control to user process +2024-05-14 11:42:14,427 WARNING MsgRouterThr:70755 [router.py:message_loop():77] message_loop has been closed diff --git a/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/config.yaml b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..94e6680d4b29b6bfb6fe3ef64a034b423a17ad41 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/config.yaml @@ -0,0 +1,43 @@ +wandb_version: 1 + +_wandb: + desc: null + value: + python_version: 3.10.12 + cli_version: 0.17.0 + framework: huggingface + huggingface_version: 4.41.0 + is_jupyter_run: false + is_kaggle_kernel: false + start_time: 1716404063 + t: + 1: + - 1 + - 5 + - 11 + - 49 + - 51 + - 53 + - 55 + - 71 + - 98 + - 100 + 2: + - 1 + - 5 + - 11 + - 49 + - 51 + - 53 + - 55 + - 71 + - 98 + - 100 + 3: + - 23 + 4: 3.10.12 + 5: 0.17.0 + 6: 4.41.0 + 8: + - 5 + 13: linux-x86_64 diff --git a/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/output.log b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/output.log new file mode 100644 index 0000000000000000000000000000000000000000..c1a8f3920d7729b94a554761b14ef7b29db18993 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/output.log @@ -0,0 +1,34 @@ + +2024-05-22:18:54:23,706 INFO [__main__.py:251] Verbosity set to INFO +2024-05-22:18:54:32,197 INFO [__main__.py:335] Selected Tasks: ['arc_easy', 'hellaswag', 'mrpc', 'openbookqa', 'sst2', 'winogrande'] +2024-05-22:18:54:32,198 INFO [evaluator.py:131] Setting random seed to 0 | Setting numpy seed to 1234 | Setting torch manual seed to 1234 +2024-05-22:18:54:32,198 INFO [evaluator.py:177] Initializing hf model, with arguments: {'pretrained': '/mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step16000'} +2024-05-22:18:54:34,550 INFO [huggingface.py:164] Using device 'cuda' +Traceback (most recent call last): + File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main + return _run_code(code, main_globals, None, + File "/usr/lib/python3.10/runpy.py", line 86, in _run_code + exec(code, run_globals) + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/__main__.py", line 417, in + cli_evaluate() + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/__main__.py", line 341, in cli_evaluate + results = evaluator.simple_evaluate( + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/utils.py", line 288, in _wrapper + return fn(*args, **kwargs) + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/evaluator.py", line 180, in simple_evaluate + lm = lm_eval.api.registry.get_model(model).create_from_arg_string( + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/api/model.py", line 134, in create_from_arg_string + return cls(**args, **args2) + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/models/huggingface.py", line 190, in __init__ + self._get_config( + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/models/huggingface.py", line 471, in _get_config + self._config = transformers.AutoConfig.from_pretrained( + File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/configuration_auto.py", line 934, in from_pretrained + config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs) + File "/usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py", line 632, in get_config_dict + config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs) + File "/usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py", line 689, in _get_config_dict + resolved_config_file = cached_file( + File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 370, in cached_file + raise EnvironmentError( +OSError: /mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step16000 does not appear to have a file named config.json. Checkout 'https://huggingface.co//mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step16000/tree/main' for available files. \ No newline at end of file diff --git a/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/requirements.txt b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..a3573b3bbfd5b190fed4ccaed4ac2846002aec22 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/requirements.txt @@ -0,0 +1,155 @@ +DataProperty==1.0.1 +GitPython==3.1.43 +Jinja2==3.1.4 +Markdown==3.6 +MarkupSafe==2.1.5 +Pillow-SIMD==7.0.0.post3 +PyYAML==6.0 +Werkzeug==3.0.3 +absl-py==2.1.0 +accelerate==0.30.1 +aiohttp==3.9.5 +aiosignal==1.3.1 +async-timeout==4.0.3 +attrs==23.2.0 +av==9.2.0 +cachetools==5.3.3 +certifi==2024.2.2 +cffi==1.15.1 +cfgv==3.4.0 +chardet==5.2.0 +charset-normalizer==3.3.2 +click==8.1.7 +cmake==3.29.2 +colorama==0.4.6 +datasets==2.19.1 +deepspeed==0.12.4+hpu.synapse.v1.15.1 +dill==0.3.8 +distlib==0.3.8 +docker-pycreds==0.4.0 +einops==0.8.0 +evaluate==0.4.2 +exceptiongroup==1.2.1 +expecttest==0.2.1 +filelock==3.14.0 +frozenlist==1.4.1 +fsspec==2024.3.1 +gitdb==4.0.11 +google-auth-oauthlib==0.4.6 +google-auth==2.29.0 +grpcio==1.63.0 +habana-media-loader==1.15.1.15 +habana-pyhlml==1.15.1.15 +habana-torch-dataloader==1.15.1.15 +habana-torch-plugin==1.15.1.15 +habana_gpu_migration==1.15.1.15 +habana_quantization_toolkit==1.15.1.15 +hjson==3.1.0 +huggingface-hub==0.23.1 +identify==2.5.36 +idna==3.7 +iniconfig==2.0.0 +joblib==1.4.2 +jsonlines==4.0.0 +lightning-habana==1.4.0 +lightning-utilities==0.11.2 +lightning==2.2.0.post0 +lm_eval==0.4.2 +lm_eval==0.4.2 +lm_eval==0.4.2 +lxml==5.2.2 +mbstrdecoder==1.1.3 +more-itertools==10.2.0 +mpi4py==3.1.4 +mpmath==1.3.0 +multidict==6.0.5 +multiprocess==0.70.16 +networkx==3.3 +ninja==1.11.1.1 +nltk==3.8.1 +nodeenv==1.8.0 +numexpr==2.10.0 +numpy==1.23.5 +oauthlib==3.2.2 +packaging==24.0 +pandas==2.0.1 +pathspec==0.12.1 +pathvalidate==3.2.0 +peft==0.11.1 +perfetto==0.7.0 +pillow==10.3.0 +pip==22.0.2 +pip==23.3.1 +platformdirs==4.2.1 +pluggy==1.5.0 +portalocker==2.8.2 +pre-commit==3.3.3 +pretty-errors==1.2.25 +protobuf==3.20.3 +psutil==5.9.8 +py-cpuinfo==9.0.0 +pyarrow-hotfix==0.6 +pyarrow==16.1.0 +pyasn1==0.6.0 +pyasn1_modules==0.4.0 +pybind11==2.10.4 +pycparser==2.22 +pydantic==1.10.13 +pynvml==8.0.4 +pytablewriter==1.2.0 +pytest==8.2.0 +python-dateutil==2.9.0.post0 +pytorch-lightning==2.2.4 +pytz==2024.1 +regex==2023.5.5 +requests-oauthlib==2.0.0 +requests==2.31.0 +rouge_score==0.1.2 +rsa==4.9 +sacrebleu==2.4.2 +safetensors==0.4.3 +scikit-learn==1.5.0 +scipy==1.13.0 +sentencepiece==0.2.0 +sentry-sdk==2.2.1 +setproctitle==1.3.3 +setuptools==59.6.0 +setuptools==69.5.1 +six==1.16.0 +smmap==5.0.1 +sqlitedict==2.1.0 +symengine==0.11.0 +sympy==1.12 +tabledata==1.3.3 +tabulate==0.9.0 +tcolorpy==0.1.6 +tdqm==0.0.1 +tensorboard-data-server==0.6.1 +tensorboard-plugin-wit==1.8.1 +tensorboard==2.11.2 +threadpoolctl==3.5.0 +tokenizers==0.19.1 +tomli==2.0.1 +torch==2.2.0a0+git8964477 +torch_tb_profiler==0.4.0 +torchaudio==2.2.0+08901ad +torchdata==0.7.1+5e6f7b7 +torchmetrics==1.4.0 +torchtext==0.17.0+400da5c +torchvision==0.17.0+b2383d4 +tqdm-multiprocess==0.0.11 +tqdm==4.66.4 +transformers==4.41.0 +typepy==1.3.2 +typing_extensions==4.11.0 +tzdata==2024.1 +urllib3==1.26.18 +virtualenv==20.26.1 +wandb==0.17.0 +wheel==0.37.1 +wheel==0.43.0 +word2number==1.1 +xxhash==3.4.1 +yamllint==1.35.1 +yarl==1.9.4 +zstandard==0.22.0 \ No newline at end of file diff --git a/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-metadata.json b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..180827e155a9d5d1ff450853d84117ebb6edc8b4 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-metadata.json @@ -0,0 +1,850 @@ +{ + "os": "Linux-5.15.0-92-generic-x86_64-with-glibc2.35", + "python": "3.10.12", + "heartbeatAt": "2024-05-22T18:54:23.497672", + "startedAt": "2024-05-22T18:54:22.990268", + "docker": null, + "cuda": null, + "args": [ + "--model", + "hf", + "--model_args", + "pretrained=/mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step16000", + "--tasks", + "hellaswag,arc_easy,openbookqa,winogrande,sst2,mrpc", + "--batch_size", + "auto", + "--wandb_args", + "project=bharatgpt,group=trial_expt_2" + ], + "state": "running", + "program": "-m lm_eval.__main__", + "codePathLocal": null, + "git": { + "remote": "https://github.com/EleutherAI/lm-evaluation-harness", + "commit": null + }, + "email": null, + "root": "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness", + "host": "peacock-evaluation-worker-0", + "username": "root", + "executable": "/usr/bin/python3", + "cpu_count": 80, + "cpu_count_logical": 160, + "cpu_freq": { + "current": 2354.6169937500003, + "min": 800.0, + "max": 3400.0 + }, + "cpu_freq_per_core": [ + { + "current": 3400.002, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + } + ], + "disk": { + "/": { + "total": 877.6341285705566, + "used": 211.6357650756836 + } + }, + "memory": { + "total": 1007.4379997253418 + } +} diff --git a/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-summary.json b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-summary.json new file mode 100644 index 0000000000000000000000000000000000000000..8bf99d152ad35c3699ec8600ecb8b169d4e35875 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-summary.json @@ -0,0 +1 @@ +{"_wandb": {"runtime": 11}} \ No newline at end of file diff --git a/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/logs/debug-internal.log b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/logs/debug-internal.log new file mode 100644 index 0000000000000000000000000000000000000000..8f7e7eb9745183128c9cecd10b4cfd8afa40b124 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/logs/debug-internal.log @@ -0,0 +1,182 @@ +2024-05-22 18:54:23,014 INFO StreamThr :1823 [internal.py:wandb_internal():85] W&B internal server running at pid: 1823, started at: 2024-05-22 18:54:23.011966 +2024-05-22 18:54:23,018 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: status +2024-05-22 18:54:23,019 INFO WriterThread:1823 [datastore.py:open_for_write():87] open: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/run-zh0ccxj5.wandb +2024-05-22 18:54:23,021 DEBUG SenderThread:1823 [sender.py:send():378] send: header +2024-05-22 18:54:23,024 DEBUG SenderThread:1823 [sender.py:send():378] send: run +2024-05-22 18:54:23,300 INFO SenderThread:1823 [dir_watcher.py:__init__():211] watching files in: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files +2024-05-22 18:54:23,300 INFO SenderThread:1823 [sender.py:_start_run_threads():1123] run started: zh0ccxj5 with start time 1716404063.011821 +2024-05-22 18:54:23,304 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: check_version +2024-05-22 18:54:23,304 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: check_version +2024-05-22 18:54:23,421 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: run_start +2024-05-22 18:54:23,423 DEBUG HandlerThread:1823 [system_info.py:__init__():26] System info init +2024-05-22 18:54:23,423 DEBUG HandlerThread:1823 [system_info.py:__init__():41] System info init done +2024-05-22 18:54:23,423 INFO HandlerThread:1823 [system_monitor.py:start():194] Starting system monitor +2024-05-22 18:54:23,423 INFO SystemMonitor:1823 [system_monitor.py:_start():158] Starting system asset monitoring threads +2024-05-22 18:54:23,423 INFO HandlerThread:1823 [system_monitor.py:probe():214] Collecting system info +2024-05-22 18:54:23,430 INFO SystemMonitor:1823 [interfaces.py:start():188] Started cpu monitoring +2024-05-22 18:54:23,436 INFO SystemMonitor:1823 [interfaces.py:start():188] Started disk monitoring +2024-05-22 18:54:23,436 INFO SystemMonitor:1823 [interfaces.py:start():188] Started memory monitoring +2024-05-22 18:54:23,437 INFO SystemMonitor:1823 [interfaces.py:start():188] Started network monitoring +2024-05-22 18:54:23,497 DEBUG HandlerThread:1823 [system_info.py:probe():150] Probing system +2024-05-22 18:54:23,501 DEBUG HandlerThread:1823 [system_info.py:_probe_git():135] Probing git +2024-05-22 18:54:23,511 ERROR HandlerThread:1823 [gitlib.py:root():92] git root error: Cmd('git') failed due to: exit code(128) + cmdline: git rev-parse --show-toplevel + stderr: 'fatal: detected dubious ownership in repository at '/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness' +To add an exception for this directory, call: + + git config --global --add safe.directory /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness' +2024-05-22 18:54:23,511 DEBUG HandlerThread:1823 [system_info.py:_probe_git():143] Probing git done +2024-05-22 18:54:23,511 DEBUG HandlerThread:1823 [system_info.py:probe():198] Probing system done +2024-05-22 18:54:23,511 DEBUG HandlerThread:1823 [system_monitor.py:probe():223] {'os': 'Linux-5.15.0-92-generic-x86_64-with-glibc2.35', 'python': '3.10.12', 'heartbeatAt': '2024-05-22T18:54:23.497672', 'startedAt': '2024-05-22T18:54:22.990268', 'docker': None, 'cuda': None, 'args': ('--model', 'hf', '--model_args', 'pretrained=/mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step16000', '--tasks', 'hellaswag,arc_easy,openbookqa,winogrande,sst2,mrpc', '--batch_size', 'auto', '--wandb_args', 'project=bharatgpt,group=trial_expt_2'), 'state': 'running', 'program': '-m lm_eval.__main__', 'codePathLocal': None, 'git': {'remote': 'https://github.com/EleutherAI/lm-evaluation-harness', 'commit': None}, 'email': None, 'root': '/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness', 'host': 'peacock-evaluation-worker-0', 'username': 'root', 'executable': '/usr/bin/python3', 'cpu_count': 80, 'cpu_count_logical': 160, 'cpu_freq': {'current': 2354.6169937500003, 'min': 800.0, 'max': 3400.0}, 'cpu_freq_per_core': [{'current': 3400.002, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}], 'disk': {'/': {'total': 877.6341285705566, 'used': 211.6357650756836}}, 'memory': {'total': 1007.4379997253418}} +2024-05-22 18:54:23,511 INFO HandlerThread:1823 [system_monitor.py:probe():224] Finished collecting system info +2024-05-22 18:54:23,511 INFO HandlerThread:1823 [system_monitor.py:probe():227] Publishing system info +2024-05-22 18:54:23,514 INFO HandlerThread:1823 [system_monitor.py:probe():229] Finished publishing system info +2024-05-22 18:54:23,519 DEBUG SenderThread:1823 [sender.py:send():378] send: files +2024-05-22 18:54:23,519 INFO SenderThread:1823 [sender.py:_save_file():1389] saving file wandb-metadata.json with policy now +2024-05-22 18:54:23,700 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: python_packages +2024-05-22 18:54:23,700 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: python_packages +2024-05-22 18:54:23,703 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: stop_status +2024-05-22 18:54:23,706 DEBUG SenderThread:1823 [sender.py:send():378] send: telemetry +2024-05-22 18:54:23,706 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: stop_status +2024-05-22 18:54:24,084 INFO wandb-upload_0:1823 [upload_job.py:push():130] Uploaded file /tmp/tmpeyrdw6uywandb/ifyklkno-wandb-metadata.json +2024-05-22 18:54:24,302 INFO Thread-12 :1823 [dir_watcher.py:_on_file_created():271] file/dir created: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/requirements.txt +2024-05-22 18:54:24,303 INFO Thread-12 :1823 [dir_watcher.py:_on_file_created():271] file/dir created: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-metadata.json +2024-05-22 18:54:24,303 INFO Thread-12 :1823 [dir_watcher.py:_on_file_created():271] file/dir created: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/output.log +2024-05-22 18:54:26,302 INFO Thread-12 :1823 [dir_watcher.py:_on_file_modified():288] file/dir modified: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/output.log +2024-05-22 18:54:28,816 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: status_report +2024-05-22 18:54:34,199 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: status_report +2024-05-22 18:54:34,310 INFO Thread-12 :1823 [dir_watcher.py:_on_file_modified():288] file/dir modified: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/output.log +2024-05-22 18:54:34,558 DEBUG SenderThread:1823 [sender.py:send():378] send: exit +2024-05-22 18:54:34,558 INFO SenderThread:1823 [sender.py:send_exit():585] handling exit code: 1 +2024-05-22 18:54:34,558 INFO SenderThread:1823 [sender.py:send_exit():587] handling runtime: 11 +2024-05-22 18:54:34,560 INFO SenderThread:1823 [sender.py:_save_file():1389] saving file wandb-summary.json with policy end +2024-05-22 18:54:34,560 INFO SenderThread:1823 [sender.py:send_exit():593] send defer +2024-05-22 18:54:34,560 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:34,560 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 0 +2024-05-22 18:54:34,560 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:34,560 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 0 +2024-05-22 18:54:34,560 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 1 +2024-05-22 18:54:34,560 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:34,560 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 1 +2024-05-22 18:54:34,561 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:34,561 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 1 +2024-05-22 18:54:34,561 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 2 +2024-05-22 18:54:34,561 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:34,561 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 2 +2024-05-22 18:54:34,561 INFO HandlerThread:1823 [system_monitor.py:finish():203] Stopping system monitor +2024-05-22 18:54:34,561 DEBUG SystemMonitor:1823 [system_monitor.py:_start():172] Starting system metrics aggregation loop +2024-05-22 18:54:34,561 DEBUG SystemMonitor:1823 [system_monitor.py:_start():179] Finished system metrics aggregation loop +2024-05-22 18:54:34,561 DEBUG SystemMonitor:1823 [system_monitor.py:_start():183] Publishing last batch of metrics +2024-05-22 18:54:34,562 INFO HandlerThread:1823 [interfaces.py:finish():200] Joined cpu monitor +2024-05-22 18:54:34,562 INFO HandlerThread:1823 [interfaces.py:finish():200] Joined disk monitor +2024-05-22 18:54:34,562 INFO HandlerThread:1823 [interfaces.py:finish():200] Joined memory monitor +2024-05-22 18:54:34,562 INFO HandlerThread:1823 [interfaces.py:finish():200] Joined network monitor +2024-05-22 18:54:34,562 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:34,562 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 2 +2024-05-22 18:54:34,563 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 3 +2024-05-22 18:54:34,563 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:34,563 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 3 +2024-05-22 18:54:34,563 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:34,563 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 3 +2024-05-22 18:54:34,563 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 4 +2024-05-22 18:54:34,563 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:34,563 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 4 +2024-05-22 18:54:34,563 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:34,563 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 4 +2024-05-22 18:54:34,563 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 5 +2024-05-22 18:54:34,563 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:34,563 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 5 +2024-05-22 18:54:34,563 DEBUG SenderThread:1823 [sender.py:send():378] send: summary +2024-05-22 18:54:34,564 INFO SenderThread:1823 [sender.py:_save_file():1389] saving file wandb-summary.json with policy end +2024-05-22 18:54:34,564 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:34,564 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 5 +2024-05-22 18:54:34,564 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 6 +2024-05-22 18:54:34,564 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:34,564 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 6 +2024-05-22 18:54:34,565 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:34,565 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 6 +2024-05-22 18:54:34,569 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: status_report +2024-05-22 18:54:34,633 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 7 +2024-05-22 18:54:34,633 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:34,633 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 7 +2024-05-22 18:54:34,633 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:34,634 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 7 +2024-05-22 18:54:35,311 INFO Thread-12 :1823 [dir_watcher.py:_on_file_modified():288] file/dir modified: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/config.yaml +2024-05-22 18:54:35,312 INFO Thread-12 :1823 [dir_watcher.py:_on_file_created():271] file/dir created: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-summary.json +2024-05-22 18:54:35,558 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-22 18:54:35,840 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 8 +2024-05-22 18:54:35,840 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: poll_exit +2024-05-22 18:54:35,840 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:35,840 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 8 +2024-05-22 18:54:35,840 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:35,840 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 8 +2024-05-22 18:54:35,840 INFO SenderThread:1823 [job_builder.py:build():432] Attempting to build job artifact +2024-05-22 18:54:35,841 INFO SenderThread:1823 [job_builder.py:_get_source_type():576] no source found +2024-05-22 18:54:35,841 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 9 +2024-05-22 18:54:35,841 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:35,841 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 9 +2024-05-22 18:54:35,841 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:35,841 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 9 +2024-05-22 18:54:35,841 INFO SenderThread:1823 [dir_watcher.py:finish():358] shutting down directory watcher +2024-05-22 18:54:36,313 INFO SenderThread:1823 [dir_watcher.py:_on_file_modified():288] file/dir modified: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/output.log +2024-05-22 18:54:36,313 INFO SenderThread:1823 [dir_watcher.py:finish():388] scan: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files +2024-05-22 18:54:36,313 INFO SenderThread:1823 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/config.yaml config.yaml +2024-05-22 18:54:36,314 INFO SenderThread:1823 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/output.log output.log +2024-05-22 18:54:36,316 INFO SenderThread:1823 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-metadata.json wandb-metadata.json +2024-05-22 18:54:36,318 INFO SenderThread:1823 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/requirements.txt requirements.txt +2024-05-22 18:54:36,318 INFO SenderThread:1823 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-summary.json wandb-summary.json +2024-05-22 18:54:36,320 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 10 +2024-05-22 18:54:36,321 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:36,321 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 10 +2024-05-22 18:54:36,321 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:36,321 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 10 +2024-05-22 18:54:36,321 INFO SenderThread:1823 [file_pusher.py:finish():169] shutting down file pusher +2024-05-22 18:54:36,557 INFO wandb-upload_0:1823 [upload_job.py:push():130] Uploaded file /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/config.yaml +2024-05-22 18:54:36,558 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-22 18:54:36,559 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: poll_exit +2024-05-22 18:54:36,933 INFO wandb-upload_3:1823 [upload_job.py:push():130] Uploaded file /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/wandb-summary.json +2024-05-22 18:54:36,942 INFO wandb-upload_2:1823 [upload_job.py:push():130] Uploaded file /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/requirements.txt +2024-05-22 18:54:36,969 INFO wandb-upload_1:1823 [upload_job.py:push():130] Uploaded file /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/files/output.log +2024-05-22 18:54:37,169 INFO Thread-11 (_thread_body):1823 [sender.py:transition_state():613] send defer: 11 +2024-05-22 18:54:37,169 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:37,169 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 11 +2024-05-22 18:54:37,170 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:37,170 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 11 +2024-05-22 18:54:37,170 INFO SenderThread:1823 [file_pusher.py:join():175] waiting for file pusher +2024-05-22 18:54:37,170 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 12 +2024-05-22 18:54:37,170 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:37,170 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 12 +2024-05-22 18:54:37,170 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:37,170 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 12 +2024-05-22 18:54:37,170 INFO SenderThread:1823 [file_stream.py:finish():601] file stream finish called +2024-05-22 18:54:37,281 INFO SenderThread:1823 [file_stream.py:finish():605] file stream finish is done +2024-05-22 18:54:37,281 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 13 +2024-05-22 18:54:37,281 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:37,282 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 13 +2024-05-22 18:54:37,282 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:37,282 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 13 +2024-05-22 18:54:37,282 INFO SenderThread:1823 [sender.py:transition_state():613] send defer: 14 +2024-05-22 18:54:37,282 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: defer +2024-05-22 18:54:37,282 INFO HandlerThread:1823 [handler.py:handle_request_defer():184] handle defer: 14 +2024-05-22 18:54:37,282 DEBUG SenderThread:1823 [sender.py:send():378] send: final +2024-05-22 18:54:37,282 DEBUG SenderThread:1823 [sender.py:send():378] send: footer +2024-05-22 18:54:37,282 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: defer +2024-05-22 18:54:37,282 INFO SenderThread:1823 [sender.py:send_request_defer():609] handle sender defer: 14 +2024-05-22 18:54:37,283 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-22 18:54:37,283 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-22 18:54:37,283 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: server_info +2024-05-22 18:54:37,283 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: get_summary +2024-05-22 18:54:37,283 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: sampled_history +2024-05-22 18:54:37,283 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: internal_messages +2024-05-22 18:54:37,284 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: poll_exit +2024-05-22 18:54:37,284 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: poll_exit +2024-05-22 18:54:37,284 DEBUG SenderThread:1823 [sender.py:send_request():405] send_request: server_info +2024-05-22 18:54:37,337 INFO MainThread:1823 [wandb_run.py:_footer_history_summary_info():3994] rendering history +2024-05-22 18:54:37,337 INFO MainThread:1823 [wandb_run.py:_footer_history_summary_info():4026] rendering summary +2024-05-22 18:54:37,337 INFO MainThread:1823 [wandb_run.py:_footer_sync_info():3953] logging synced files +2024-05-22 18:54:37,337 DEBUG HandlerThread:1823 [handler.py:handle_request():158] handle_request: shutdown +2024-05-22 18:54:37,337 INFO HandlerThread:1823 [handler.py:finish():882] shutting down handler +2024-05-22 18:54:38,284 INFO WriterThread:1823 [datastore.py:close():296] close: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/run-zh0ccxj5.wandb +2024-05-22 18:54:38,337 INFO SenderThread:1823 [sender.py:finish():1545] shutting down sender +2024-05-22 18:54:38,337 INFO SenderThread:1823 [file_pusher.py:finish():169] shutting down file pusher +2024-05-22 18:54:38,337 INFO SenderThread:1823 [file_pusher.py:join():175] waiting for file pusher diff --git a/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/logs/debug.log b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/logs/debug.log new file mode 100644 index 0000000000000000000000000000000000000000..d653315f1f13214eab6fc95e2f73ed73263ee1e0 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/logs/debug.log @@ -0,0 +1,29 @@ +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_setup.py:_flush():76] Current SDK version is 0.17.0 +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_setup.py:_flush():76] Configure stats pid to 1668 +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_setup.py:_flush():76] Loading settings from /root/.config/wandb/settings +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_setup.py:_flush():76] Loading settings from /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/settings +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_setup.py:_flush():76] Loading settings from environment variables: {} +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_setup.py:_flush():76] Applying setup settings: {'_disable_service': False} +2024-05-22 18:54:23,006 WARNING MainThread:1668 [wandb_setup.py:_flush():76] Could not find program at -m lm_eval.__main__ +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_setup.py:_flush():76] Inferring run settings from compute environment: {'program_relpath': None, 'program': '-m lm_eval.__main__'} +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_setup.py:_flush():76] Applying login settings: {} +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_init.py:_log_setup():520] Logging user logs to /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/logs/debug.log +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_init.py:_log_setup():521] Logging internal logs to /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/logs/debug-internal.log +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_init.py:init():560] calling init triggers +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_init.py:init():567] wandb.init called with sweep_config: {} +config: {} +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_init.py:init():610] starting backend +2024-05-22 18:54:23,006 INFO MainThread:1668 [wandb_init.py:init():614] setting up manager +2024-05-22 18:54:23,010 INFO MainThread:1668 [backend.py:_multiprocessing_setup():105] multiprocessing start_methods=fork,spawn,forkserver, using: spawn +2024-05-22 18:54:23,011 INFO MainThread:1668 [wandb_init.py:init():622] backend started and connected +2024-05-22 18:54:23,015 INFO MainThread:1668 [wandb_init.py:init():711] updated telemetry +2024-05-22 18:54:23,024 INFO MainThread:1668 [wandb_init.py:init():744] communicating run to backend with 90.0 second timeout +2024-05-22 18:54:23,304 INFO MainThread:1668 [wandb_run.py:_on_init():2396] communicating current version +2024-05-22 18:54:23,414 INFO MainThread:1668 [wandb_run.py:_on_init():2405] got version response +2024-05-22 18:54:23,415 INFO MainThread:1668 [wandb_init.py:init():795] starting run threads in backend +2024-05-22 18:54:23,701 INFO MainThread:1668 [wandb_run.py:_console_start():2374] atexit reg +2024-05-22 18:54:23,702 INFO MainThread:1668 [wandb_run.py:_redirect():2229] redirect: wrap_raw +2024-05-22 18:54:23,702 INFO MainThread:1668 [wandb_run.py:_redirect():2294] Wrapping output streams. +2024-05-22 18:54:23,702 INFO MainThread:1668 [wandb_run.py:_redirect():2319] Redirects installed. +2024-05-22 18:54:23,704 INFO MainThread:1668 [wandb_init.py:init():838] run started, returning control to user process +2024-05-22 18:54:38,338 WARNING MsgRouterThr:1668 [router.py:message_loop():77] message_loop has been closed diff --git a/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/run-zh0ccxj5.wandb b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/run-zh0ccxj5.wandb new file mode 100644 index 0000000000000000000000000000000000000000..ca99980f820b6eb7904b986ac87884cb3a72a681 Binary files /dev/null and b/lm-evaluation-harness/wandb/run-20240522_185422-zh0ccxj5/run-zh0ccxj5.wandb differ diff --git a/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/config.yaml b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..78d58d425884faa74a2330663c42bf72fe7088dc --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/config.yaml @@ -0,0 +1,43 @@ +wandb_version: 1 + +_wandb: + desc: null + value: + python_version: 3.10.12 + cli_version: 0.17.0 + framework: huggingface + huggingface_version: 4.41.1 + is_jupyter_run: false + is_kaggle_kernel: false + start_time: 1716467553 + t: + 1: + - 1 + - 5 + - 11 + - 49 + - 51 + - 53 + - 55 + - 71 + - 98 + - 100 + 2: + - 1 + - 5 + - 11 + - 49 + - 51 + - 53 + - 55 + - 71 + - 98 + - 100 + 3: + - 23 + 4: 3.10.12 + 5: 0.17.0 + 6: 4.41.1 + 8: + - 5 + 13: linux-x86_64 diff --git a/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/output.log b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/output.log new file mode 100644 index 0000000000000000000000000000000000000000..fa3e8ec54bb88b5ee100647f83736e91ecc55c49 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/output.log @@ -0,0 +1,34 @@ + +2024-05-23:12:32:34,528 INFO [__main__.py:251] Verbosity set to INFO +2024-05-23:12:32:42,944 INFO [__main__.py:335] Selected Tasks: ['arc_easy', 'hellaswag', 'mrpc', 'openbookqa', 'sst2', 'winogrande'] +2024-05-23:12:32:42,945 INFO [evaluator.py:131] Setting random seed to 0 | Setting numpy seed to 1234 | Setting torch manual seed to 1234 +2024-05-23:12:32:42,945 INFO [evaluator.py:177] Initializing hf model, with arguments: {'pretrained': '/mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step18000'} +2024-05-23:12:32:45,281 INFO [huggingface.py:164] Using device 'cuda' +Traceback (most recent call last): + File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main + return _run_code(code, main_globals, None, + File "/usr/lib/python3.10/runpy.py", line 86, in _run_code + exec(code, run_globals) + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/__main__.py", line 417, in + cli_evaluate() + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/__main__.py", line 341, in cli_evaluate + results = evaluator.simple_evaluate( + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/utils.py", line 288, in _wrapper + return fn(*args, **kwargs) + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/evaluator.py", line 180, in simple_evaluate + lm = lm_eval.api.registry.get_model(model).create_from_arg_string( + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/api/model.py", line 134, in create_from_arg_string + return cls(**args, **args2) + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/models/huggingface.py", line 190, in __init__ + self._get_config( + File "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/lm_eval/models/huggingface.py", line 471, in _get_config + self._config = transformers.AutoConfig.from_pretrained( + File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/configuration_auto.py", line 934, in from_pretrained + config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs) + File "/usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py", line 632, in get_config_dict + config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs) + File "/usr/local/lib/python3.10/dist-packages/transformers/configuration_utils.py", line 689, in _get_config_dict + resolved_config_file = cached_file( + File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 370, in cached_file + raise EnvironmentError( +OSError: /mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step18000 does not appear to have a file named config.json. Checkout 'https://huggingface.co//mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step18000/tree/main' for available files. \ No newline at end of file diff --git a/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/requirements.txt b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..f675c3016b5332c1acf28f436e0b60adeead9c12 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/requirements.txt @@ -0,0 +1,155 @@ +DataProperty==1.0.1 +GitPython==3.1.43 +Jinja2==3.1.4 +Markdown==3.6 +MarkupSafe==2.1.5 +Pillow-SIMD==7.0.0.post3 +PyYAML==6.0 +Werkzeug==3.0.3 +absl-py==2.1.0 +accelerate==0.30.1 +aiohttp==3.9.5 +aiosignal==1.3.1 +async-timeout==4.0.3 +attrs==23.2.0 +av==9.2.0 +cachetools==5.3.3 +certifi==2024.2.2 +cffi==1.15.1 +cfgv==3.4.0 +chardet==5.2.0 +charset-normalizer==3.3.2 +click==8.1.7 +cmake==3.29.2 +colorama==0.4.6 +datasets==2.19.1 +deepspeed==0.12.4+hpu.synapse.v1.15.1 +dill==0.3.8 +distlib==0.3.8 +docker-pycreds==0.4.0 +einops==0.8.0 +evaluate==0.4.2 +exceptiongroup==1.2.1 +expecttest==0.2.1 +filelock==3.14.0 +frozenlist==1.4.1 +fsspec==2024.3.1 +gitdb==4.0.11 +google-auth-oauthlib==0.4.6 +google-auth==2.29.0 +grpcio==1.63.0 +habana-media-loader==1.15.1.15 +habana-pyhlml==1.15.1.15 +habana-torch-dataloader==1.15.1.15 +habana-torch-plugin==1.15.1.15 +habana_gpu_migration==1.15.1.15 +habana_quantization_toolkit==1.15.1.15 +hjson==3.1.0 +huggingface-hub==0.23.1 +identify==2.5.36 +idna==3.7 +iniconfig==2.0.0 +joblib==1.4.2 +jsonlines==4.0.0 +lightning-habana==1.4.0 +lightning-utilities==0.11.2 +lightning==2.2.0.post0 +lm_eval==0.4.2 +lm_eval==0.4.2 +lm_eval==0.4.2 +lxml==5.2.2 +mbstrdecoder==1.1.3 +more-itertools==10.2.0 +mpi4py==3.1.4 +mpmath==1.3.0 +multidict==6.0.5 +multiprocess==0.70.16 +networkx==3.3 +ninja==1.11.1.1 +nltk==3.8.1 +nodeenv==1.8.0 +numexpr==2.10.0 +numpy==1.23.5 +oauthlib==3.2.2 +packaging==24.0 +pandas==2.0.1 +pathspec==0.12.1 +pathvalidate==3.2.0 +peft==0.11.1 +perfetto==0.7.0 +pillow==10.3.0 +pip==22.0.2 +pip==23.3.1 +platformdirs==4.2.1 +pluggy==1.5.0 +portalocker==2.8.2 +pre-commit==3.3.3 +pretty-errors==1.2.25 +protobuf==3.20.3 +psutil==5.9.8 +py-cpuinfo==9.0.0 +pyarrow-hotfix==0.6 +pyarrow==16.1.0 +pyasn1==0.6.0 +pyasn1_modules==0.4.0 +pybind11==2.10.4 +pycparser==2.22 +pydantic==1.10.13 +pynvml==8.0.4 +pytablewriter==1.2.0 +pytest==8.2.0 +python-dateutil==2.9.0.post0 +pytorch-lightning==2.2.4 +pytz==2024.1 +regex==2023.5.5 +requests-oauthlib==2.0.0 +requests==2.31.0 +rouge_score==0.1.2 +rsa==4.9 +sacrebleu==2.4.2 +safetensors==0.4.3 +scikit-learn==1.5.0 +scipy==1.13.1 +sentencepiece==0.2.0 +sentry-sdk==2.3.0 +setproctitle==1.3.3 +setuptools==59.6.0 +setuptools==69.5.1 +six==1.16.0 +smmap==5.0.1 +sqlitedict==2.1.0 +symengine==0.11.0 +sympy==1.12 +tabledata==1.3.3 +tabulate==0.9.0 +tcolorpy==0.1.6 +tdqm==0.0.1 +tensorboard-data-server==0.6.1 +tensorboard-plugin-wit==1.8.1 +tensorboard==2.11.2 +threadpoolctl==3.5.0 +tokenizers==0.19.1 +tomli==2.0.1 +torch==2.2.0a0+git8964477 +torch_tb_profiler==0.4.0 +torchaudio==2.2.0+08901ad +torchdata==0.7.1+5e6f7b7 +torchmetrics==1.4.0 +torchtext==0.17.0+400da5c +torchvision==0.17.0+b2383d4 +tqdm-multiprocess==0.0.11 +tqdm==4.66.4 +transformers==4.41.1 +typepy==1.3.2 +typing_extensions==4.11.0 +tzdata==2024.1 +urllib3==1.26.18 +virtualenv==20.26.1 +wandb==0.17.0 +wheel==0.37.1 +wheel==0.43.0 +word2number==1.1 +xxhash==3.4.1 +yamllint==1.35.1 +yarl==1.9.4 +zstandard==0.22.0 \ No newline at end of file diff --git a/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-metadata.json b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..7c53450952a0c9bb6ff99742ccf34b000609aec3 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-metadata.json @@ -0,0 +1,850 @@ +{ + "os": "Linux-5.15.0-92-generic-x86_64-with-glibc2.35", + "python": "3.10.12", + "heartbeatAt": "2024-05-23T12:32:34.321159", + "startedAt": "2024-05-23T12:32:33.784550", + "docker": null, + "cuda": null, + "args": [ + "--model", + "hf", + "--model_args", + "pretrained=/mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step18000", + "--tasks", + "hellaswag,arc_easy,openbookqa,winogrande,sst2,mrpc", + "--batch_size", + "auto", + "--wandb_args", + "project=bharatgpt,group=trial_expt_2" + ], + "state": "running", + "program": "-m lm_eval.__main__", + "codePathLocal": null, + "git": { + "remote": "https://github.com/EleutherAI/lm-evaluation-harness", + "commit": null + }, + "email": null, + "root": "/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness", + "host": "peacock-evaluation-worker-0", + "username": "root", + "executable": "/usr/bin/python3", + "cpu_count": 80, + "cpu_count_logical": 160, + "cpu_freq": { + "current": 2334.3514875, + "min": 800.0, + "max": 3400.0 + }, + "cpu_freq_per_core": [ + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 3400.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + }, + { + "current": 2300.0, + "min": 800.0, + "max": 3400.0 + } + ], + "disk": { + "/": { + "total": 877.6341285705566, + "used": 209.58247756958008 + } + }, + "memory": { + "total": 1007.4379425048828 + } +} diff --git a/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-summary.json b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-summary.json new file mode 100644 index 0000000000000000000000000000000000000000..8bf99d152ad35c3699ec8600ecb8b169d4e35875 --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-summary.json @@ -0,0 +1 @@ +{"_wandb": {"runtime": 11}} \ No newline at end of file diff --git a/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/logs/debug-internal.log b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/logs/debug-internal.log new file mode 100644 index 0000000000000000000000000000000000000000..968c6dccc07b26bbdda706fbad22e2af465e6b7a --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/logs/debug-internal.log @@ -0,0 +1,183 @@ +2024-05-23 12:32:33,807 INFO StreamThr :2088 [internal.py:wandb_internal():85] W&B internal server running at pid: 2088, started at: 2024-05-23 12:32:33.804991 +2024-05-23 12:32:33,811 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: status +2024-05-23 12:32:33,812 INFO WriterThread:2088 [datastore.py:open_for_write():87] open: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/run-gdvgjem8.wandb +2024-05-23 12:32:33,814 DEBUG SenderThread:2088 [sender.py:send():378] send: header +2024-05-23 12:32:33,818 DEBUG SenderThread:2088 [sender.py:send():378] send: run +2024-05-23 12:32:34,121 INFO SenderThread:2088 [dir_watcher.py:__init__():211] watching files in: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files +2024-05-23 12:32:34,121 INFO SenderThread:2088 [sender.py:_start_run_threads():1123] run started: gdvgjem8 with start time 1716467553.804851 +2024-05-23 12:32:34,124 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: check_version +2024-05-23 12:32:34,124 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: check_version +2024-05-23 12:32:34,245 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: run_start +2024-05-23 12:32:34,247 DEBUG HandlerThread:2088 [system_info.py:__init__():26] System info init +2024-05-23 12:32:34,247 DEBUG HandlerThread:2088 [system_info.py:__init__():41] System info init done +2024-05-23 12:32:34,248 INFO HandlerThread:2088 [system_monitor.py:start():194] Starting system monitor +2024-05-23 12:32:34,248 INFO SystemMonitor:2088 [system_monitor.py:_start():158] Starting system asset monitoring threads +2024-05-23 12:32:34,248 INFO HandlerThread:2088 [system_monitor.py:probe():214] Collecting system info +2024-05-23 12:32:34,254 INFO SystemMonitor:2088 [interfaces.py:start():188] Started cpu monitoring +2024-05-23 12:32:34,255 INFO SystemMonitor:2088 [interfaces.py:start():188] Started disk monitoring +2024-05-23 12:32:34,255 INFO SystemMonitor:2088 [interfaces.py:start():188] Started memory monitoring +2024-05-23 12:32:34,255 INFO SystemMonitor:2088 [interfaces.py:start():188] Started network monitoring +2024-05-23 12:32:34,321 DEBUG HandlerThread:2088 [system_info.py:probe():150] Probing system +2024-05-23 12:32:34,324 DEBUG HandlerThread:2088 [system_info.py:_probe_git():135] Probing git +2024-05-23 12:32:34,334 ERROR HandlerThread:2088 [gitlib.py:root():92] git root error: Cmd('git') failed due to: exit code(128) + cmdline: git rev-parse --show-toplevel + stderr: 'fatal: detected dubious ownership in repository at '/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness' +To add an exception for this directory, call: + + git config --global --add safe.directory /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness' +2024-05-23 12:32:34,334 DEBUG HandlerThread:2088 [system_info.py:_probe_git():143] Probing git done +2024-05-23 12:32:34,334 DEBUG HandlerThread:2088 [system_info.py:probe():198] Probing system done +2024-05-23 12:32:34,334 DEBUG HandlerThread:2088 [system_monitor.py:probe():223] {'os': 'Linux-5.15.0-92-generic-x86_64-with-glibc2.35', 'python': '3.10.12', 'heartbeatAt': '2024-05-23T12:32:34.321159', 'startedAt': '2024-05-23T12:32:33.784550', 'docker': None, 'cuda': None, 'args': ('--model', 'hf', '--model_args', 'pretrained=/mnt/weka/peacock/experiments/llama/checkpoint/llamav2-3b//hf_ckpt//global_step18000', '--tasks', 'hellaswag,arc_easy,openbookqa,winogrande,sst2,mrpc', '--batch_size', 'auto', '--wandb_args', 'project=bharatgpt,group=trial_expt_2'), 'state': 'running', 'program': '-m lm_eval.__main__', 'codePathLocal': None, 'git': {'remote': 'https://github.com/EleutherAI/lm-evaluation-harness', 'commit': None}, 'email': None, 'root': '/mnt/weka/peacock/idc/cronscript/lm-evaluation-harness', 'host': 'peacock-evaluation-worker-0', 'username': 'root', 'executable': '/usr/bin/python3', 'cpu_count': 80, 'cpu_count_logical': 160, 'cpu_freq': {'current': 2334.3514875, 'min': 800.0, 'max': 3400.0}, 'cpu_freq_per_core': [{'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 3400.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}, {'current': 2300.0, 'min': 800.0, 'max': 3400.0}], 'disk': {'/': {'total': 877.6341285705566, 'used': 209.58247756958008}}, 'memory': {'total': 1007.4379425048828}} +2024-05-23 12:32:34,334 INFO HandlerThread:2088 [system_monitor.py:probe():224] Finished collecting system info +2024-05-23 12:32:34,334 INFO HandlerThread:2088 [system_monitor.py:probe():227] Publishing system info +2024-05-23 12:32:34,337 INFO HandlerThread:2088 [system_monitor.py:probe():229] Finished publishing system info +2024-05-23 12:32:34,342 DEBUG SenderThread:2088 [sender.py:send():378] send: files +2024-05-23 12:32:34,342 INFO SenderThread:2088 [sender.py:_save_file():1389] saving file wandb-metadata.json with policy now +2024-05-23 12:32:34,522 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: python_packages +2024-05-23 12:32:34,522 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: python_packages +2024-05-23 12:32:34,525 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: stop_status +2024-05-23 12:32:34,528 DEBUG SenderThread:2088 [sender.py:send():378] send: telemetry +2024-05-23 12:32:34,528 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: stop_status +2024-05-23 12:32:34,977 INFO wandb-upload_0:2088 [upload_job.py:push():130] Uploaded file /tmp/tmpzhxrpqsnwandb/pvqc07st-wandb-metadata.json +2024-05-23 12:32:35,123 INFO Thread-12 :2088 [dir_watcher.py:_on_file_created():271] file/dir created: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/output.log +2024-05-23 12:32:35,123 INFO Thread-12 :2088 [dir_watcher.py:_on_file_created():271] file/dir created: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-metadata.json +2024-05-23 12:32:35,123 INFO Thread-12 :2088 [dir_watcher.py:_on_file_created():271] file/dir created: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/requirements.txt +2024-05-23 12:32:37,123 INFO Thread-12 :2088 [dir_watcher.py:_on_file_modified():288] file/dir modified: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/output.log +2024-05-23 12:32:39,674 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: status_report +2024-05-23 12:32:44,946 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: status_report +2024-05-23 12:32:45,130 INFO Thread-12 :2088 [dir_watcher.py:_on_file_modified():288] file/dir modified: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/output.log +2024-05-23 12:32:45,293 DEBUG SenderThread:2088 [sender.py:send():378] send: exit +2024-05-23 12:32:45,293 INFO SenderThread:2088 [sender.py:send_exit():585] handling exit code: 1 +2024-05-23 12:32:45,293 INFO SenderThread:2088 [sender.py:send_exit():587] handling runtime: 11 +2024-05-23 12:32:45,294 INFO SenderThread:2088 [sender.py:_save_file():1389] saving file wandb-summary.json with policy end +2024-05-23 12:32:45,295 INFO SenderThread:2088 [sender.py:send_exit():593] send defer +2024-05-23 12:32:45,295 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:45,295 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 0 +2024-05-23 12:32:45,295 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:45,295 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 0 +2024-05-23 12:32:45,295 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 1 +2024-05-23 12:32:45,295 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:45,295 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 1 +2024-05-23 12:32:45,295 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:45,295 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 1 +2024-05-23 12:32:45,295 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 2 +2024-05-23 12:32:45,295 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:45,295 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 2 +2024-05-23 12:32:45,295 INFO HandlerThread:2088 [system_monitor.py:finish():203] Stopping system monitor +2024-05-23 12:32:45,296 DEBUG SystemMonitor:2088 [system_monitor.py:_start():172] Starting system metrics aggregation loop +2024-05-23 12:32:45,296 DEBUG SystemMonitor:2088 [system_monitor.py:_start():179] Finished system metrics aggregation loop +2024-05-23 12:32:45,296 INFO HandlerThread:2088 [interfaces.py:finish():200] Joined cpu monitor +2024-05-23 12:32:45,296 DEBUG SystemMonitor:2088 [system_monitor.py:_start():183] Publishing last batch of metrics +2024-05-23 12:32:45,296 INFO HandlerThread:2088 [interfaces.py:finish():200] Joined disk monitor +2024-05-23 12:32:45,298 INFO HandlerThread:2088 [interfaces.py:finish():200] Joined memory monitor +2024-05-23 12:32:45,298 INFO HandlerThread:2088 [interfaces.py:finish():200] Joined network monitor +2024-05-23 12:32:45,299 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:45,299 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 2 +2024-05-23 12:32:45,299 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 3 +2024-05-23 12:32:45,299 DEBUG SenderThread:2088 [sender.py:send():378] send: stats +2024-05-23 12:32:45,300 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:45,300 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 3 +2024-05-23 12:32:45,300 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:45,300 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 3 +2024-05-23 12:32:45,300 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 4 +2024-05-23 12:32:45,300 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:45,300 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 4 +2024-05-23 12:32:45,300 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:45,300 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 4 +2024-05-23 12:32:45,300 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 5 +2024-05-23 12:32:45,301 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:45,301 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 5 +2024-05-23 12:32:45,301 DEBUG SenderThread:2088 [sender.py:send():378] send: summary +2024-05-23 12:32:45,301 INFO SenderThread:2088 [sender.py:_save_file():1389] saving file wandb-summary.json with policy end +2024-05-23 12:32:45,302 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:45,302 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 5 +2024-05-23 12:32:45,302 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 6 +2024-05-23 12:32:45,302 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:45,302 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 6 +2024-05-23 12:32:45,302 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:45,302 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 6 +2024-05-23 12:32:45,307 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: status_report +2024-05-23 12:32:45,390 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 7 +2024-05-23 12:32:45,390 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:45,390 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 7 +2024-05-23 12:32:45,390 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:45,390 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 7 +2024-05-23 12:32:46,131 INFO Thread-12 :2088 [dir_watcher.py:_on_file_modified():288] file/dir modified: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/config.yaml +2024-05-23 12:32:46,132 INFO Thread-12 :2088 [dir_watcher.py:_on_file_created():271] file/dir created: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-summary.json +2024-05-23 12:32:46,293 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-23 12:32:46,694 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 8 +2024-05-23 12:32:46,694 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: poll_exit +2024-05-23 12:32:46,695 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:46,695 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 8 +2024-05-23 12:32:46,695 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:46,695 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 8 +2024-05-23 12:32:46,695 INFO SenderThread:2088 [job_builder.py:build():432] Attempting to build job artifact +2024-05-23 12:32:46,695 INFO SenderThread:2088 [job_builder.py:_get_source_type():576] no source found +2024-05-23 12:32:46,695 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 9 +2024-05-23 12:32:46,696 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:46,696 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 9 +2024-05-23 12:32:46,696 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:46,696 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 9 +2024-05-23 12:32:46,696 INFO SenderThread:2088 [dir_watcher.py:finish():358] shutting down directory watcher +2024-05-23 12:32:47,133 INFO SenderThread:2088 [dir_watcher.py:_on_file_modified():288] file/dir modified: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/output.log +2024-05-23 12:32:47,133 INFO SenderThread:2088 [dir_watcher.py:finish():388] scan: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files +2024-05-23 12:32:47,133 INFO SenderThread:2088 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/requirements.txt requirements.txt +2024-05-23 12:32:47,133 INFO SenderThread:2088 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/output.log output.log +2024-05-23 12:32:47,136 INFO SenderThread:2088 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/config.yaml config.yaml +2024-05-23 12:32:47,138 INFO SenderThread:2088 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-summary.json wandb-summary.json +2024-05-23 12:32:47,138 INFO SenderThread:2088 [dir_watcher.py:finish():402] scan save: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-metadata.json wandb-metadata.json +2024-05-23 12:32:47,138 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 10 +2024-05-23 12:32:47,140 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:47,140 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 10 +2024-05-23 12:32:47,143 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:47,143 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 10 +2024-05-23 12:32:47,144 INFO SenderThread:2088 [file_pusher.py:finish():169] shutting down file pusher +2024-05-23 12:32:47,293 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-23 12:32:47,293 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: poll_exit +2024-05-23 12:32:47,369 INFO wandb-upload_0:2088 [upload_job.py:push():130] Uploaded file /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/requirements.txt +2024-05-23 12:32:47,741 INFO wandb-upload_3:2088 [upload_job.py:push():130] Uploaded file /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/wandb-summary.json +2024-05-23 12:32:47,755 INFO wandb-upload_2:2088 [upload_job.py:push():130] Uploaded file /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/config.yaml +2024-05-23 12:32:47,767 INFO wandb-upload_1:2088 [upload_job.py:push():130] Uploaded file /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/files/output.log +2024-05-23 12:32:47,967 INFO Thread-11 (_thread_body):2088 [sender.py:transition_state():613] send defer: 11 +2024-05-23 12:32:47,967 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:47,967 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 11 +2024-05-23 12:32:47,967 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:47,967 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 11 +2024-05-23 12:32:47,967 INFO SenderThread:2088 [file_pusher.py:join():175] waiting for file pusher +2024-05-23 12:32:47,968 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 12 +2024-05-23 12:32:47,968 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:47,968 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 12 +2024-05-23 12:32:47,968 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:47,968 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 12 +2024-05-23 12:32:47,968 INFO SenderThread:2088 [file_stream.py:finish():601] file stream finish called +2024-05-23 12:32:48,033 INFO SenderThread:2088 [file_stream.py:finish():605] file stream finish is done +2024-05-23 12:32:48,033 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 13 +2024-05-23 12:32:48,033 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:48,033 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 13 +2024-05-23 12:32:48,033 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:48,033 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 13 +2024-05-23 12:32:48,033 INFO SenderThread:2088 [sender.py:transition_state():613] send defer: 14 +2024-05-23 12:32:48,033 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: defer +2024-05-23 12:32:48,034 INFO HandlerThread:2088 [handler.py:handle_request_defer():184] handle defer: 14 +2024-05-23 12:32:48,034 DEBUG SenderThread:2088 [sender.py:send():378] send: final +2024-05-23 12:32:48,034 DEBUG SenderThread:2088 [sender.py:send():378] send: footer +2024-05-23 12:32:48,034 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: defer +2024-05-23 12:32:48,034 INFO SenderThread:2088 [sender.py:send_request_defer():609] handle sender defer: 14 +2024-05-23 12:32:48,035 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-23 12:32:48,035 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: poll_exit +2024-05-23 12:32:48,035 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: server_info +2024-05-23 12:32:48,035 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: get_summary +2024-05-23 12:32:48,035 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: sampled_history +2024-05-23 12:32:48,035 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: internal_messages +2024-05-23 12:32:48,035 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: poll_exit +2024-05-23 12:32:48,035 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: poll_exit +2024-05-23 12:32:48,035 DEBUG SenderThread:2088 [sender.py:send_request():405] send_request: server_info +2024-05-23 12:32:48,098 INFO MainThread:2088 [wandb_run.py:_footer_history_summary_info():3994] rendering history +2024-05-23 12:32:48,098 INFO MainThread:2088 [wandb_run.py:_footer_history_summary_info():4026] rendering summary +2024-05-23 12:32:48,098 INFO MainThread:2088 [wandb_run.py:_footer_sync_info():3953] logging synced files +2024-05-23 12:32:48,098 DEBUG HandlerThread:2088 [handler.py:handle_request():158] handle_request: shutdown +2024-05-23 12:32:48,098 INFO HandlerThread:2088 [handler.py:finish():882] shutting down handler +2024-05-23 12:32:49,035 INFO WriterThread:2088 [datastore.py:close():296] close: /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/run-gdvgjem8.wandb +2024-05-23 12:32:49,098 INFO SenderThread:2088 [sender.py:finish():1545] shutting down sender +2024-05-23 12:32:49,098 INFO SenderThread:2088 [file_pusher.py:finish():169] shutting down file pusher +2024-05-23 12:32:49,098 INFO SenderThread:2088 [file_pusher.py:join():175] waiting for file pusher diff --git a/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/logs/debug.log b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/logs/debug.log new file mode 100644 index 0000000000000000000000000000000000000000..5185616a56a3e6a8ddd87b06b2cce7169b0e329b --- /dev/null +++ b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/logs/debug.log @@ -0,0 +1,29 @@ +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_setup.py:_flush():76] Current SDK version is 0.17.0 +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_setup.py:_flush():76] Configure stats pid to 1933 +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_setup.py:_flush():76] Loading settings from /root/.config/wandb/settings +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_setup.py:_flush():76] Loading settings from /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/settings +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_setup.py:_flush():76] Loading settings from environment variables: {} +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_setup.py:_flush():76] Applying setup settings: {'_disable_service': False} +2024-05-23 12:32:33,800 WARNING MainThread:1933 [wandb_setup.py:_flush():76] Could not find program at -m lm_eval.__main__ +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_setup.py:_flush():76] Inferring run settings from compute environment: {'program_relpath': None, 'program': '-m lm_eval.__main__'} +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_setup.py:_flush():76] Applying login settings: {} +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_init.py:_log_setup():520] Logging user logs to /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/logs/debug.log +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_init.py:_log_setup():521] Logging internal logs to /mnt/weka/peacock/idc/cronscript/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/logs/debug-internal.log +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_init.py:init():560] calling init triggers +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_init.py:init():567] wandb.init called with sweep_config: {} +config: {} +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_init.py:init():610] starting backend +2024-05-23 12:32:33,800 INFO MainThread:1933 [wandb_init.py:init():614] setting up manager +2024-05-23 12:32:33,803 INFO MainThread:1933 [backend.py:_multiprocessing_setup():105] multiprocessing start_methods=fork,spawn,forkserver, using: spawn +2024-05-23 12:32:33,804 INFO MainThread:1933 [wandb_init.py:init():622] backend started and connected +2024-05-23 12:32:33,808 INFO MainThread:1933 [wandb_init.py:init():711] updated telemetry +2024-05-23 12:32:33,817 INFO MainThread:1933 [wandb_init.py:init():744] communicating run to backend with 90.0 second timeout +2024-05-23 12:32:34,124 INFO MainThread:1933 [wandb_run.py:_on_init():2396] communicating current version +2024-05-23 12:32:34,239 INFO MainThread:1933 [wandb_run.py:_on_init():2405] got version response +2024-05-23 12:32:34,239 INFO MainThread:1933 [wandb_init.py:init():795] starting run threads in backend +2024-05-23 12:32:34,523 INFO MainThread:1933 [wandb_run.py:_console_start():2374] atexit reg +2024-05-23 12:32:34,523 INFO MainThread:1933 [wandb_run.py:_redirect():2229] redirect: wrap_raw +2024-05-23 12:32:34,523 INFO MainThread:1933 [wandb_run.py:_redirect():2294] Wrapping output streams. +2024-05-23 12:32:34,523 INFO MainThread:1933 [wandb_run.py:_redirect():2319] Redirects installed. +2024-05-23 12:32:34,525 INFO MainThread:1933 [wandb_init.py:init():838] run started, returning control to user process +2024-05-23 12:32:49,099 WARNING MsgRouterThr:1933 [router.py:message_loop():77] message_loop has been closed diff --git a/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/run-gdvgjem8.wandb b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/run-gdvgjem8.wandb new file mode 100644 index 0000000000000000000000000000000000000000..c6adc80a4fb1a7f272350c7fced03da0b7da9f33 Binary files /dev/null and b/lm-evaluation-harness/wandb/run-20240523_123233-gdvgjem8/run-gdvgjem8.wandb differ diff --git a/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/INSTALLER b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/LICENSE b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/METADATA b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..34b08eaddcc0e2db0c01cf82187d4c7bf64b5c44 --- /dev/null +++ b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/METADATA @@ -0,0 +1,296 @@ +Metadata-Version: 2.1 +Name: huggingface-hub +Version: 0.22.2 +Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub +Home-page: https://github.com/huggingface/huggingface_hub +Author: Hugging Face, Inc. +Author-email: julien@huggingface.co +License: Apache +Keywords: model-hub machine-learning models natural-language-processing deep-learning pytorch pretrained-models +Platform: UNKNOWN +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Education +Classifier: Intended Audience :: Science/Research +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence +Requires-Python: >=3.8.0 +Description-Content-Type: text/markdown +License-File: LICENSE +Requires-Dist: filelock +Requires-Dist: fsspec >=2023.5.0 +Requires-Dist: packaging >=20.9 +Requires-Dist: pyyaml >=5.1 +Requires-Dist: requests +Requires-Dist: tqdm >=4.42.1 +Requires-Dist: typing-extensions >=3.7.4.3 +Provides-Extra: all +Requires-Dist: InquirerPy ==0.3.4 ; extra == 'all' +Requires-Dist: aiohttp ; extra == 'all' +Requires-Dist: minijinja >=1.0 ; extra == 'all' +Requires-Dist: jedi ; extra == 'all' +Requires-Dist: Jinja2 ; extra == 'all' +Requires-Dist: pytest ; extra == 'all' +Requires-Dist: pytest-cov ; extra == 'all' +Requires-Dist: pytest-env ; extra == 'all' +Requires-Dist: pytest-xdist ; extra == 'all' +Requires-Dist: pytest-vcr ; extra == 'all' +Requires-Dist: pytest-asyncio ; extra == 'all' +Requires-Dist: pytest-rerunfailures ; extra == 'all' +Requires-Dist: urllib3 <2.0 ; extra == 'all' +Requires-Dist: soundfile ; extra == 'all' +Requires-Dist: Pillow ; extra == 'all' +Requires-Dist: gradio ; extra == 'all' +Requires-Dist: numpy ; extra == 'all' +Requires-Dist: ruff >=0.3.0 ; extra == 'all' +Requires-Dist: mypy ==1.5.1 ; extra == 'all' +Requires-Dist: typing-extensions >=4.8.0 ; extra == 'all' +Requires-Dist: types-PyYAML ; extra == 'all' +Requires-Dist: types-requests ; extra == 'all' +Requires-Dist: types-simplejson ; extra == 'all' +Requires-Dist: types-toml ; extra == 'all' +Requires-Dist: types-tqdm ; extra == 'all' +Requires-Dist: types-urllib3 ; extra == 'all' +Provides-Extra: cli +Requires-Dist: InquirerPy ==0.3.4 ; extra == 'cli' +Provides-Extra: dev +Requires-Dist: InquirerPy ==0.3.4 ; extra == 'dev' +Requires-Dist: aiohttp ; extra == 'dev' +Requires-Dist: minijinja >=1.0 ; extra == 'dev' +Requires-Dist: jedi ; extra == 'dev' +Requires-Dist: Jinja2 ; extra == 'dev' +Requires-Dist: pytest ; extra == 'dev' +Requires-Dist: pytest-cov ; extra == 'dev' +Requires-Dist: pytest-env ; extra == 'dev' +Requires-Dist: pytest-xdist ; extra == 'dev' +Requires-Dist: pytest-vcr ; extra == 'dev' +Requires-Dist: pytest-asyncio ; extra == 'dev' +Requires-Dist: pytest-rerunfailures ; extra == 'dev' +Requires-Dist: urllib3 <2.0 ; extra == 'dev' +Requires-Dist: soundfile ; extra == 'dev' +Requires-Dist: Pillow ; extra == 'dev' +Requires-Dist: gradio ; extra == 'dev' +Requires-Dist: numpy ; extra == 'dev' +Requires-Dist: ruff >=0.3.0 ; extra == 'dev' +Requires-Dist: mypy ==1.5.1 ; extra == 'dev' +Requires-Dist: typing-extensions >=4.8.0 ; extra == 'dev' +Requires-Dist: types-PyYAML ; extra == 'dev' +Requires-Dist: types-requests ; extra == 'dev' +Requires-Dist: types-simplejson ; extra == 'dev' +Requires-Dist: types-toml ; extra == 'dev' +Requires-Dist: types-tqdm ; extra == 'dev' +Requires-Dist: types-urllib3 ; extra == 'dev' +Provides-Extra: fastai +Requires-Dist: toml ; extra == 'fastai' +Requires-Dist: fastai >=2.4 ; extra == 'fastai' +Requires-Dist: fastcore >=1.3.27 ; extra == 'fastai' +Provides-Extra: hf_transfer +Requires-Dist: hf-transfer >=0.1.4 ; extra == 'hf_transfer' +Provides-Extra: inference +Requires-Dist: aiohttp ; extra == 'inference' +Requires-Dist: minijinja >=1.0 ; extra == 'inference' +Provides-Extra: quality +Requires-Dist: ruff >=0.3.0 ; extra == 'quality' +Requires-Dist: mypy ==1.5.1 ; extra == 'quality' +Provides-Extra: tensorflow +Requires-Dist: tensorflow ; extra == 'tensorflow' +Requires-Dist: pydot ; extra == 'tensorflow' +Requires-Dist: graphviz ; extra == 'tensorflow' +Provides-Extra: tensorflow-testing +Requires-Dist: tensorflow ; extra == 'tensorflow-testing' +Requires-Dist: keras <3.0 ; extra == 'tensorflow-testing' +Provides-Extra: testing +Requires-Dist: InquirerPy ==0.3.4 ; extra == 'testing' +Requires-Dist: aiohttp ; extra == 'testing' +Requires-Dist: minijinja >=1.0 ; extra == 'testing' +Requires-Dist: jedi ; extra == 'testing' +Requires-Dist: Jinja2 ; extra == 'testing' +Requires-Dist: pytest ; extra == 'testing' +Requires-Dist: pytest-cov ; extra == 'testing' +Requires-Dist: pytest-env ; extra == 'testing' +Requires-Dist: pytest-xdist ; extra == 'testing' +Requires-Dist: pytest-vcr ; extra == 'testing' +Requires-Dist: pytest-asyncio ; extra == 'testing' +Requires-Dist: pytest-rerunfailures ; extra == 'testing' +Requires-Dist: urllib3 <2.0 ; extra == 'testing' +Requires-Dist: soundfile ; extra == 'testing' +Requires-Dist: Pillow ; extra == 'testing' +Requires-Dist: gradio ; extra == 'testing' +Requires-Dist: numpy ; extra == 'testing' +Provides-Extra: torch +Requires-Dist: torch ; extra == 'torch' +Requires-Dist: safetensors ; extra == 'torch' +Provides-Extra: typing +Requires-Dist: typing-extensions >=4.8.0 ; extra == 'typing' +Requires-Dist: types-PyYAML ; extra == 'typing' +Requires-Dist: types-requests ; extra == 'typing' +Requires-Dist: types-simplejson ; extra == 'typing' +Requires-Dist: types-toml ; extra == 'typing' +Requires-Dist: types-tqdm ; extra == 'typing' +Requires-Dist: types-urllib3 ; extra == 'typing' + +

+
+ huggingface_hub library logo +
+

+ +

+ The official Python client for the Huggingface Hub. +

+ +

+ Documentation + GitHub release + PyPi version + downloads + Code coverage +

+ +

+

+ English | + Deutsch | + हिंदी | + 한국어 | + 中文(简体) +

+

+--- + +**Documentation**: https://hf.co/docs/huggingface_hub + +**Source Code**: https://github.com/huggingface/huggingface_hub + +--- + +## Welcome to the huggingface_hub library + +The `huggingface_hub` library allows you to interact with the [Hugging Face Hub](https://huggingface.co/), a platform democratizing open-source Machine Learning for creators and collaborators. Discover pre-trained models and datasets for your projects or play with the thousands of machine learning apps hosted on the Hub. You can also create and share your own models, datasets and demos with the community. The `huggingface_hub` library provides a simple way to do all these things with Python. + +## Key features + +- [Download files](https://huggingface.co/docs/huggingface_hub/en/guides/download) from the Hub. +- [Upload files](https://huggingface.co/docs/huggingface_hub/en/guides/upload) to the Hub. +- [Manage your repositories](https://huggingface.co/docs/huggingface_hub/en/guides/repository). +- [Run Inference](https://huggingface.co/docs/huggingface_hub/en/guides/inference) on deployed models. +- [Search](https://huggingface.co/docs/huggingface_hub/en/guides/search) for models, datasets and Spaces. +- [Share Model Cards](https://huggingface.co/docs/huggingface_hub/en/guides/model-cards) to document your models. +- [Engage with the community](https://huggingface.co/docs/huggingface_hub/en/guides/community) through PRs and comments. + +## Installation + +Install the `huggingface_hub` package with [pip](https://pypi.org/project/huggingface-hub/): + +```bash +pip install huggingface_hub +``` + +If you prefer, you can also install it with [conda](https://huggingface.co/docs/huggingface_hub/en/installation#install-with-conda). + +In order to keep the package minimal by default, `huggingface_hub` comes with optional dependencies useful for some use cases. For example, if you want have a complete experience for Inference, run: + +```bash +pip install huggingface_hub[inference] +``` + +To learn more installation and optional dependencies, check out the [installation guide](https://huggingface.co/docs/huggingface_hub/en/installation). + +## Quick start + +### Download files + +Download a single file + +```py +from huggingface_hub import hf_hub_download + +hf_hub_download(repo_id="tiiuae/falcon-7b-instruct", filename="config.json") +``` + +Or an entire repository + +```py +from huggingface_hub import snapshot_download + +snapshot_download("stabilityai/stable-diffusion-2-1") +``` + +Files will be downloaded in a local cache folder. More details in [this guide](https://huggingface.co/docs/huggingface_hub/en/guides/manage-cache). + +### Login + +The Hugging Face Hub uses tokens to authenticate applications (see [docs](https://huggingface.co/docs/hub/security-tokens)). To login your machine, run the following CLI: + +```bash +huggingface-cli login +# or using an environment variable +huggingface-cli login --token $HUGGINGFACE_TOKEN +``` + +### Create a repository + +```py +from huggingface_hub import create_repo + +create_repo(repo_id="super-cool-model") +``` + +### Upload files + +Upload a single file + +```py +from huggingface_hub import upload_file + +upload_file( + path_or_fileobj="/home/lysandre/dummy-test/README.md", + path_in_repo="README.md", + repo_id="lysandre/test-model", +) +``` + +Or an entire folder + +```py +from huggingface_hub import upload_folder + +upload_folder( + folder_path="/path/to/local/space", + repo_id="username/my-cool-space", + repo_type="space", +) +``` + +For details in the [upload guide](https://huggingface.co/docs/huggingface_hub/en/guides/upload). + +## Integrating to the Hub. + +We're partnering with cool open source ML libraries to provide free model hosting and versioning. You can find the existing integrations [here](https://huggingface.co/docs/hub/libraries). + +The advantages are: + +- Free model or dataset hosting for libraries and their users. +- Built-in file versioning, even with very large files, thanks to a git-based approach. +- Serverless inference API for all models publicly available. +- In-browser widgets to play with the uploaded models. +- Anyone can upload a new model for your library, they just need to add the corresponding tag for the model to be discoverable. +- Fast downloads! We use Cloudfront (a CDN) to geo-replicate downloads so they're blazing fast from anywhere on the globe. +- Usage stats and more features to come. + +If you would like to integrate your library, feel free to open an issue to begin the discussion. We wrote a [step-by-step guide](https://huggingface.co/docs/hub/adding-a-library) with ❤️ showing how to do this integration. + +## Contributions (feature requests, bugs, etc.) are super welcome 💙💚💛💜🧡❤️ + +Everyone is welcome to contribute, and we value everybody's contribution. Code is not the only way to help the community. +Answering questions, helping others, reaching out and improving the documentations are immensely valuable to the community. +We wrote a [contribution guide](https://github.com/huggingface/huggingface_hub/blob/main/CONTRIBUTING.md) to summarize +how to get started to contribute to this repository. + + diff --git a/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/RECORD b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..95d89299bc4dbedf9529dbc6e188cd9f9a97372e --- /dev/null +++ b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/RECORD @@ -0,0 +1,220 @@ +../../../bin/huggingface-cli,sha256=MHJnoQrGXB7el4CcouFgtEo3z-2BIBras8Al-VJSBJY,268 +huggingface_hub-0.22.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +huggingface_hub-0.22.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357 +huggingface_hub-0.22.2.dist-info/METADATA,sha256=9S0T9nMXn6Q7cesvjVBiSk4oEid8LZ3gT9fuJLGrWNk,12869 +huggingface_hub-0.22.2.dist-info/RECORD,, +huggingface_hub-0.22.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92 +huggingface_hub-0.22.2.dist-info/entry_points.txt,sha256=Y3Z2L02rBG7va_iE6RPXolIgwOdwUFONyRN3kXMxZ0g,131 +huggingface_hub-0.22.2.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16 +huggingface_hub/__init__.py,sha256=lDulrtedaTz17qYF0AzTHuRanxwgeGlVdq6TxmIcuQQ,31075 +huggingface_hub/__pycache__/__init__.cpython-310.pyc,, +huggingface_hub/__pycache__/_commit_api.cpython-310.pyc,, +huggingface_hub/__pycache__/_commit_scheduler.cpython-310.pyc,, +huggingface_hub/__pycache__/_inference_endpoints.cpython-310.pyc,, +huggingface_hub/__pycache__/_login.cpython-310.pyc,, +huggingface_hub/__pycache__/_multi_commits.cpython-310.pyc,, +huggingface_hub/__pycache__/_snapshot_download.cpython-310.pyc,, +huggingface_hub/__pycache__/_space_api.cpython-310.pyc,, +huggingface_hub/__pycache__/_tensorboard_logger.cpython-310.pyc,, +huggingface_hub/__pycache__/_webhooks_payload.cpython-310.pyc,, +huggingface_hub/__pycache__/_webhooks_server.cpython-310.pyc,, +huggingface_hub/__pycache__/community.cpython-310.pyc,, +huggingface_hub/__pycache__/constants.cpython-310.pyc,, +huggingface_hub/__pycache__/errors.cpython-310.pyc,, +huggingface_hub/__pycache__/fastai_utils.cpython-310.pyc,, +huggingface_hub/__pycache__/file_download.cpython-310.pyc,, +huggingface_hub/__pycache__/hf_api.cpython-310.pyc,, +huggingface_hub/__pycache__/hf_file_system.cpython-310.pyc,, +huggingface_hub/__pycache__/hub_mixin.cpython-310.pyc,, +huggingface_hub/__pycache__/inference_api.cpython-310.pyc,, +huggingface_hub/__pycache__/keras_mixin.cpython-310.pyc,, +huggingface_hub/__pycache__/lfs.cpython-310.pyc,, +huggingface_hub/__pycache__/repocard.cpython-310.pyc,, +huggingface_hub/__pycache__/repocard_data.cpython-310.pyc,, +huggingface_hub/__pycache__/repository.cpython-310.pyc,, +huggingface_hub/_commit_api.py,sha256=_6NggUJsCBdspCJjXbvZYXH6vLBOnkG6I2E1kc8aJm8,29194 +huggingface_hub/_commit_scheduler.py,sha256=FgfjYv3E0oK3iBxDdy45Y7t78FWkmjnBR4dRd5aZviU,13653 +huggingface_hub/_inference_endpoints.py,sha256=wGcnxZNFCbMK77SA90fPsZ9bqNGwPopSVr-sTbdw3o8,15763 +huggingface_hub/_login.py,sha256=jNTFCnou-eZAtMWl1PDuyZhmpW3O-f4qff9m5hU0UGk,15364 +huggingface_hub/_multi_commits.py,sha256=rtN0AaHzamXi1cvr1r2MlqR6y-laZxgRo-30J_I3RwM,12519 +huggingface_hub/_snapshot_download.py,sha256=lXsSWaDSOP0hH5_9tOSBazNAtWSBhN8dMcjrLY7hNIc,15677 +huggingface_hub/_space_api.py,sha256=Mae_lqTRyTWyszI5mlObJ2fn9slPxkFPcFTEVADoNQM,5255 +huggingface_hub/_tensorboard_logger.py,sha256=uqmkKBKyj6_9XfWq563afgARenZ7-fjEHb16rgY24-Y,7166 +huggingface_hub/_webhooks_payload.py,sha256=cF9iWOOacOZfqKGcuVhykDgAZHrHON7VMuLwwehl6O8,2832 +huggingface_hub/_webhooks_server.py,sha256=fDbyDu28qhJJQb8tKpH1C8l4cJSvC3Gr2sUo1DbIoD8,15197 +huggingface_hub/commands/__init__.py,sha256=AkbM2a-iGh0Vq_xAWhK3mu3uZ44km8-X5uWjKcvcrUQ,928 +huggingface_hub/commands/__pycache__/__init__.cpython-310.pyc,, +huggingface_hub/commands/__pycache__/_cli_utils.cpython-310.pyc,, +huggingface_hub/commands/__pycache__/delete_cache.cpython-310.pyc,, +huggingface_hub/commands/__pycache__/download.cpython-310.pyc,, +huggingface_hub/commands/__pycache__/env.cpython-310.pyc,, +huggingface_hub/commands/__pycache__/huggingface_cli.cpython-310.pyc,, +huggingface_hub/commands/__pycache__/lfs.cpython-310.pyc,, +huggingface_hub/commands/__pycache__/scan_cache.cpython-310.pyc,, +huggingface_hub/commands/__pycache__/upload.cpython-310.pyc,, +huggingface_hub/commands/__pycache__/user.cpython-310.pyc,, +huggingface_hub/commands/_cli_utils.py,sha256=qRdl9opi3yJxIVNCnrmte-jFWmYbjVqd8gBlin8NNzY,1971 +huggingface_hub/commands/delete_cache.py,sha256=Rb1BtIltJPnQ-th7tcK_L4mFqfk785t3KXV77xXKBP4,16131 +huggingface_hub/commands/download.py,sha256=yGq9SlTRHR6TBrky_VBIyo68e0gnMLgYPBYIBG7d9bQ,9167 +huggingface_hub/commands/env.py,sha256=yYl4DSS14V8t244nAi0t77Izx5LIdgS_dy6xiV5VQME,1226 +huggingface_hub/commands/huggingface_cli.py,sha256=o862C98OcZoyqCzY7mNpia1h0KaLJUgSb0y10ot8sxA,1924 +huggingface_hub/commands/lfs.py,sha256=6E769AoRxUDiIOapn1_QvTbNtdUnUiouu2F4Gopp4do,7318 +huggingface_hub/commands/scan_cache.py,sha256=4o_jQsZloicRa-P8gncUBncVyWswpSF9T6KGlNrGodk,5183 +huggingface_hub/commands/upload.py,sha256=Mr69qO60otqCVw0sVSBPykUTkL9HO-pkCyulSD2mROM,13622 +huggingface_hub/commands/user.py,sha256=QApZJOCQEHADhjunM3hlQ72uqHsearCiCE4SdpzGdcc,6893 +huggingface_hub/community.py,sha256=SBaOfI-3atCzRbO0gDS8BYxctbdvD4G0X6D0GfY8Fgc,12203 +huggingface_hub/constants.py,sha256=8r0JaNMhLR8X6pC6TnNBLQ-TVcHEbRWk1sJ-LSIj444,7821 +huggingface_hub/errors.py,sha256=jCYKeSOsQNfH2t3TsW8kIAXXS1aWl9PaAq3prFfz4CI,704 +huggingface_hub/fastai_utils.py,sha256=5I7zAfgHJU_mZnxnf9wgWTHrCRu_EAV8VTangDVfE_o,16676 +huggingface_hub/file_download.py,sha256=DmOEVmhEsRnX8M0kZmLPLC76eptMT0riTwtThFioV8Q,77476 +huggingface_hub/hf_api.py,sha256=dJsdtW6WJW04h84BE46FOg8Pp34AgYhg-NbMg9WrReY,367303 +huggingface_hub/hf_file_system.py,sha256=JUCT-VZBesDCB-uN__fvQt3uprGQETGnUlzjC7StQLM,37272 +huggingface_hub/hub_mixin.py,sha256=xkUTJiP5TiAiVj6ts9Thffcm4wufZS3jMWil3LB2uvw,30423 +huggingface_hub/inference/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +huggingface_hub/inference/__pycache__/__init__.cpython-310.pyc,, +huggingface_hub/inference/__pycache__/_client.cpython-310.pyc,, +huggingface_hub/inference/__pycache__/_common.cpython-310.pyc,, +huggingface_hub/inference/__pycache__/_templating.cpython-310.pyc,, +huggingface_hub/inference/__pycache__/_types.cpython-310.pyc,, +huggingface_hub/inference/_client.py,sha256=D4O07nYFo7v5lXZ7id3zubV6u8_RxhTVStoeAgEBs-E,104854 +huggingface_hub/inference/_common.py,sha256=BOOBNpF0_V8fDXsi2q5eQ9i4KIlPS6VfMxYxLSgkRdM,16570 +huggingface_hub/inference/_generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +huggingface_hub/inference/_generated/__pycache__/__init__.cpython-310.pyc,, +huggingface_hub/inference/_generated/__pycache__/_async_client.cpython-310.pyc,, +huggingface_hub/inference/_generated/_async_client.py,sha256=d7fvZyyBNnG9zivHS7rCwaR7TlETN7JENR-M_ZEo_3c,108053 +huggingface_hub/inference/_generated/types/__init__.py,sha256=SoKeNQ8JjBgKkQIgBTsWJe4-Z75Ebz6WkdL4ZQ27yNc,4450 +huggingface_hub/inference/_generated/types/__pycache__/__init__.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/audio_classification.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/audio_to_audio.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/automatic_speech_recognition.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/base.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/chat_completion.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/depth_estimation.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/document_question_answering.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/feature_extraction.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/fill_mask.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/image_classification.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/image_segmentation.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/image_to_image.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/image_to_text.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/object_detection.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/question_answering.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/sentence_similarity.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/summarization.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/table_question_answering.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/text2text_generation.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/text_classification.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/text_generation.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/text_to_audio.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/text_to_image.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/token_classification.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/translation.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/video_classification.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/visual_question_answering.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/zero_shot_classification.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/zero_shot_image_classification.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/__pycache__/zero_shot_object_detection.cpython-310.pyc,, +huggingface_hub/inference/_generated/types/audio_classification.py,sha256=wk4kUTLQZoXWLpiUOpKRHRRE-JYqqJlzGVe62VACR-0,1347 +huggingface_hub/inference/_generated/types/audio_to_audio.py,sha256=n7GeCepzt254yoSLsdjrI1j4fzYgjWzxoaKE5gZJc48,881 +huggingface_hub/inference/_generated/types/automatic_speech_recognition.py,sha256=-7UHu5QTGwSrJFnrbMgzeUFpJQOGyTmfK_QHgtnx6j8,5352 +huggingface_hub/inference/_generated/types/base.py,sha256=Cq4gUVtwwLmWyiIIq4NSL8kRk0EWk9QWWHc5Vup2LVg,6213 +huggingface_hub/inference/_generated/types/chat_completion.py,sha256=cI-gWOgqEBnwhxwn21OShkKOs3mbjjzJ1Ow2pzLQEwc,3616 +huggingface_hub/inference/_generated/types/depth_estimation.py,sha256=lmLmd8S313ZMCG94RblwquL0UN_0hJmXAhWUqSIrtwc,898 +huggingface_hub/inference/_generated/types/document_question_answering.py,sha256=_hBzK4Pu9X_zXsgOO4JNSloIKuVfE5m7eGwEw5YTfZ4,3264 +huggingface_hub/inference/_generated/types/feature_extraction.py,sha256=KerTrRR5YR02X0qBDzrtK8953amCGf_adSUbfWOozD4,664 +huggingface_hub/inference/_generated/types/fill_mask.py,sha256=JcYIbTDXc4f7k2FNY3fCWtJ9ke3HUZFz2pDOOrDuxOs,1714 +huggingface_hub/inference/_generated/types/image_classification.py,sha256=W1QVfc0j7t6qbxjICUQDwygRx43yPPGZKyStogHkHqg,1359 +huggingface_hub/inference/_generated/types/image_segmentation.py,sha256=nVQc5Qhv37qqmTn_M8xegpNgk14ozKelsGIYC8hba_0,1803 +huggingface_hub/inference/_generated/types/image_to_image.py,sha256=MbubS9pD8bFP9LoI4QoQxJwpUGeNXi5iSEk8Ymhbh0M,1797 +huggingface_hub/inference/_generated/types/image_to_text.py,sha256=mloLf-LO7oR_2HbPY1-XMM18BfjMODytRaxTXYkIXoY,4827 +huggingface_hub/inference/_generated/types/object_detection.py,sha256=F8ly6GSE8dupsekPVf6G5nI8teZAIP4iXw6u3zm1JiE,1569 +huggingface_hub/inference/_generated/types/question_answering.py,sha256=xLDy5oA-k9JPncSU6NqPAPb8rWPerfTbU857G3e7JZ0,2884 +huggingface_hub/inference/_generated/types/sentence_similarity.py,sha256=edH-TWfnZ4J0zJD-zqfcRMLwOV0dTt1g5Y0caYnVuPc,1018 +huggingface_hub/inference/_generated/types/summarization.py,sha256=RWCXh7yftI_JWvLsr7JiDpQPexq1klYP158tUICUcbM,1574 +huggingface_hub/inference/_generated/types/table_question_answering.py,sha256=PuVZlR6dI6FEUK7pjMSVMtzkDgrcxdKjfcnDbVmPdSs,1569 +huggingface_hub/inference/_generated/types/text2text_generation.py,sha256=SZYfdhyraG5vZ2Jzm1C8k9w9IYLxMtm5UUu1tU2oOQk,1604 +huggingface_hub/inference/_generated/types/text_classification.py,sha256=vC7B1sBzZ4gdLjE2i2Y7w5cpdaFwQKK1dlWqW0asjIk,1347 +huggingface_hub/inference/_generated/types/text_generation.py,sha256=VHhkhEj-yEVGuy4BYgDNzmAPBPJWL3N1B4n4SUOymNk,5866 +huggingface_hub/inference/_generated/types/text_to_audio.py,sha256=cgvECsiwsycgP9Tfs_GU1CJfo9AngVn6x9s4fHCP-g4,4819 +huggingface_hub/inference/_generated/types/text_to_image.py,sha256=oBGeJ-S9WfsMxVQlvEOll9yaCyMXZ277wsYFD8bt87U,1931 +huggingface_hub/inference/_generated/types/token_classification.py,sha256=7oL8AZOTWtf2bYD2T3236GDNMtUl7FtydaB6We7wbfw,1890 +huggingface_hub/inference/_generated/types/translation.py,sha256=MruCx6yhzQGlxSdBRXCVoEhRzRSa5Ks4bjZ1PDrlTeQ,1562 +huggingface_hub/inference/_generated/types/video_classification.py,sha256=BI2_PP-pxLT6w9TuX6QCZz4BsG-ZukTXnW6fWMchI5M,1579 +huggingface_hub/inference/_generated/types/visual_question_answering.py,sha256=0PHNnjwxxHvG3SjOz7O7DckbBeGYDsRmlagG11qIkkM,1667 +huggingface_hub/inference/_generated/types/zero_shot_classification.py,sha256=u6jfFCqDv9XqeAN5E9_Xf7jqMZgqTRFF_S9PtWbiBUk,1963 +huggingface_hub/inference/_generated/types/zero_shot_image_classification.py,sha256=qVH6Ms0FjF8TraGy4BYiS8lmvGq9xiIDdXqGFynLHMA,1689 +huggingface_hub/inference/_generated/types/zero_shot_object_detection.py,sha256=PU4OOlQ2aAOosW2JlG2Z27MEQpmE6BxcygH_ns3w1KQ,1662 +huggingface_hub/inference/_templating.py,sha256=_X7CoUjOmMh5KBXx-WGey-z3uh_fP1QT36X638UZpZw,4051 +huggingface_hub/inference/_types.py,sha256=C73l5-RO8P1UMBHF8OAO9CRUq7Xdv33pcADoJsGMPSU,1782 +huggingface_hub/inference_api.py,sha256=UXOKu_Ez2I3hDsjguqCcCrj03WFDndehpngYiIAucdg,8331 +huggingface_hub/keras_mixin.py,sha256=8L0FEIWy_kmKsGI5d61q_33dGYbmLGhy4kZbqn-YFns,19681 +huggingface_hub/lfs.py,sha256=p61RJK13gtgdu0og4KHFosy_GWYDFsQJa0JJoLYSLAk,19592 +huggingface_hub/repocard.py,sha256=oUrGim27nCHkevPDZDbUp68uKTxB8xbdoyeqv24pexc,34605 +huggingface_hub/repocard_data.py,sha256=1hIkI8xp0EmW2aR3LtHMrjIMk_W-KJxHslMjpNMwVPg,31911 +huggingface_hub/repository.py,sha256=8oNhKNvJRye3dr67cTn8faKkBSiWFgvj7bIBlOpI-8U,54489 +huggingface_hub/serialization/__init__.py,sha256=W74TaCtYnMfpvGEQr1SS-OBmqPUFnM9AeWT9hTJCG9Y,910 +huggingface_hub/serialization/__pycache__/__init__.cpython-310.pyc,, +huggingface_hub/serialization/__pycache__/_base.cpython-310.pyc,, +huggingface_hub/serialization/__pycache__/_numpy.cpython-310.pyc,, +huggingface_hub/serialization/__pycache__/_tensorflow.cpython-310.pyc,, +huggingface_hub/serialization/__pycache__/_torch.cpython-310.pyc,, +huggingface_hub/serialization/_base.py,sha256=AgO-16i-vyosbERnLSCFYgaXbVqQDM7xfIne8gsWrLQ,7133 +huggingface_hub/serialization/_numpy.py,sha256=idULJp1js6L6E8o-MiGVqNa4lBfXS2cfAmqivnpsaYs,2671 +huggingface_hub/serialization/_tensorflow.py,sha256=Rf4kw1NYxEaoUXB8aLtQLHrTjgobaEAJdzO0w0kbP58,3559 +huggingface_hub/serialization/_torch.py,sha256=xYR6e_G9laMTroWLiQRABSuloTQuuRSQNyYHdT_rmXU,7687 +huggingface_hub/templates/datasetcard_template.md,sha256=W-EMqR6wndbrnZorkVv56URWPG49l7MATGeI015kTvs,5503 +huggingface_hub/templates/modelcard_template.md,sha256=4AqArS3cqdtbit5Bo-DhjcnDFR-pza5hErLLTPM4Yuc,6870 +huggingface_hub/utils/__init__.py,sha256=XYIIkKiDeoy8dQQegBYSfILOzdt8NW_cfquY7omX0fQ,3478 +huggingface_hub/utils/__pycache__/__init__.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_cache_assets.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_cache_manager.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_chunk_utils.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_datetime.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_deprecation.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_errors.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_experimental.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_fixes.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_git_credential.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_headers.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_hf_folder.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_http.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_pagination.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_paths.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_runtime.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_safetensors.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_subprocess.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_telemetry.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_token.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_typing.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/_validators.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/endpoint_helpers.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/insecure_hashlib.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/logging.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/sha.cpython-310.pyc,, +huggingface_hub/utils/__pycache__/tqdm.cpython-310.pyc,, +huggingface_hub/utils/_cache_assets.py,sha256=kai77HPQMfYpROouMBQCr_gdBCaeTm996Sqj0dExbNg,5728 +huggingface_hub/utils/_cache_manager.py,sha256=Fs1XVP1UGzUTogMfMfEi_MfpURzHyW__djX0s2oLmrY,29307 +huggingface_hub/utils/_chunk_utils.py,sha256=kRCaj5228_vKcyLWspd8Xq01f17Jz6ds5Sr9ed5d_RU,2130 +huggingface_hub/utils/_datetime.py,sha256=DHnktKm1taeOe2XCBgNU4pVck5d70qu8FJ7nACD6C3k,2554 +huggingface_hub/utils/_deprecation.py,sha256=HZhRGGUX_QMKBBBwHHlffLtmCSK01TOpeXHefZbPfwI,4872 +huggingface_hub/utils/_errors.py,sha256=N5nUkCCaj8393wntazeTcKNrwDZfsDVHVMxxreHPfaE,15141 +huggingface_hub/utils/_experimental.py,sha256=crCPH6k6-11wwH2GZuZzZzZbjUotay49ywV1SSJhMHM,2395 +huggingface_hub/utils/_fixes.py,sha256=EqG7u36J9C3NtL5VukDilca90GV9idrENzsEVhtdbI4,2829 +huggingface_hub/utils/_git_credential.py,sha256=SDdsiREr1TcAR2Ze2TB0E5cYzVJgvDZrs60od9lAsMc,4596 +huggingface_hub/utils/_headers.py,sha256=T_C1RA0bqEYL0oiE4WdFMAKXEUPHN-D43vchjiwKcZ4,9643 +huggingface_hub/utils/_hf_folder.py,sha256=gWH-TT9h_6X_CyrtLTtKNEawf9kKlCHraFiOu09BuLk,3613 +huggingface_hub/utils/_http.py,sha256=VQcukUKXXDlDQwyG-LGVtAIr3DprVC-R_HcXZzbAfak,13543 +huggingface_hub/utils/_pagination.py,sha256=hzLFLd8i_DKkPRVYzOx2CxLt5lcocEiAxDJriQUjAjY,1841 +huggingface_hub/utils/_paths.py,sha256=Ah_diO-gSWw9TYylJl_HNB2XXftgIi36HNlKAYQHCms,4398 +huggingface_hub/utils/_runtime.py,sha256=6PxkDPWj3ltRlE2-zAr3vZTXfi1OUjxILsmRN-s_wZY,10851 +huggingface_hub/utils/_safetensors.py,sha256=EE9v9HflWBUqIegn0dCGHgNu9G9Db3v2aszvG4ldPF8,4876 +huggingface_hub/utils/_subprocess.py,sha256=34ETD8JvLzm16NRZHciaCLXdE9aRyxuDdOA5gdNvMJ8,4617 +huggingface_hub/utils/_telemetry.py,sha256=jHAdgWNcL9nVvMT3ec3i78O-cwL09GnlifuokzpQjMI,4641 +huggingface_hub/utils/_token.py,sha256=cxBZaafW2IsJ2dKWd55v7056zycW1ewp_nPk8dNcSO4,5476 +huggingface_hub/utils/_typing.py,sha256=pXh7GtVtSBD_Fvvthex9BRTAJZ6bWScUOw06oJS0Lek,2025 +huggingface_hub/utils/_validators.py,sha256=otFT4xT3s_E_-jrzH4NR7xWgK7UlRkwk_KAI9XK1mb0,9359 +huggingface_hub/utils/endpoint_helpers.py,sha256=n_VguR_L2Vl6Mi_4PFO2iAd5xaPeQRiD8KRBpzs4nMw,9536 +huggingface_hub/utils/insecure_hashlib.py,sha256=OjxlvtSQHpbLp9PWSrXBDJ0wHjxCBU-SQJgucEEXDbU,1058 +huggingface_hub/utils/logging.py,sha256=Cp03s0uEl3kDM9XHQW9a8GAoExODQ-e7kEtgMt-_To8,4728 +huggingface_hub/utils/sha.py,sha256=QLlIwPCyz46MmUc_4L8xl87KfYoBks9kPgsMZ5JCz-o,902 +huggingface_hub/utils/tqdm.py,sha256=2H80n_kDpvp7P4i7MaYR47t41i0l6ODi5mab1oof1dk,6335 diff --git a/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/WHEEL b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..bab98d675883cc7567a79df485cd7b4f015e376f --- /dev/null +++ b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.43.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/entry_points.txt b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..eb3dafd90f19de60b3e520aeaf8132402980214d --- /dev/null +++ b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/entry_points.txt @@ -0,0 +1,6 @@ +[console_scripts] +huggingface-cli = huggingface_hub.commands.huggingface_cli:main + +[fsspec.specs] +hf=huggingface_hub.HfFileSystem + diff --git a/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/top_level.txt b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..6b964ccca3c1b6766042b3fe3b2707ba25372924 --- /dev/null +++ b/venv/lib/python3.10/site-packages/huggingface_hub-0.22.2.dist-info/top_level.txt @@ -0,0 +1 @@ +huggingface_hub diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/__init__.py b/venv/lib/python3.10/site-packages/mbstrdecoder/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4cb36263b095ebba9e9a1150f9c38f6ac6019be8 --- /dev/null +++ b/venv/lib/python3.10/site-packages/mbstrdecoder/__init__.py @@ -0,0 +1,13 @@ +""" +.. codeauthor:: Tsuyoshi Hombashi +""" + +from .__version__ import __author__, __copyright__, __email__, __license__, __version__ +from ._func import detect_file_encoding +from ._mbstrdecoder import MultiByteStrDecoder + + +__all__ = ( + "detect_file_encoding", + "MultiByteStrDecoder", +) diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/__init__.cpython-310.pyc b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a61bf4c4222558911c72385659b245796f424e92 Binary files /dev/null and b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/__init__.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/__version__.cpython-310.pyc b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/__version__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..687ad890d47a69b0df9184e29ef35e2dd838556e Binary files /dev/null and b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/__version__.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/_binary_ext_checker.cpython-310.pyc b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/_binary_ext_checker.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ff350a1e085353380b05cc2b7e1e742702cc9f34 Binary files /dev/null and b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/_binary_ext_checker.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/_func.cpython-310.pyc b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/_func.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..862cf3abc3659d2ea36b2751c988ece300e3b70c Binary files /dev/null and b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/_func.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/_mbstrdecoder.cpython-310.pyc b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/_mbstrdecoder.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1755fcc409ba35437f8c9c30df2500865ec11e1c Binary files /dev/null and b/venv/lib/python3.10/site-packages/mbstrdecoder/__pycache__/_mbstrdecoder.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/__version__.py b/venv/lib/python3.10/site-packages/mbstrdecoder/__version__.py new file mode 100644 index 0000000000000000000000000000000000000000..1047f5e5099e9ee9c18279e8520927f558c5b26b --- /dev/null +++ b/venv/lib/python3.10/site-packages/mbstrdecoder/__version__.py @@ -0,0 +1,6 @@ +__author__ = "Tsuyoshi Hombashi" +__copyright__ = f"Copyright 2016, {__author__}" +__license__ = "MIT License" +__version__ = "1.1.3" +__maintainer__ = __author__ +__email__ = "tsuyoshi.hombashi@gmail.com" diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/_binary_ext_checker.py b/venv/lib/python3.10/site-packages/mbstrdecoder/_binary_ext_checker.py new file mode 100644 index 0000000000000000000000000000000000000000..217e29c9afdd9fb4949855381f76c0516902b784 --- /dev/null +++ b/venv/lib/python3.10/site-packages/mbstrdecoder/_binary_ext_checker.py @@ -0,0 +1,264 @@ +""" +.. codeauthor:: Tsuyoshi Hombashi +""" + +import os.path + + +# list from https://github.com/sindresorhus/binary-extensions +binary_exts = ( + "3dm", + "3ds", + "3g2", + "3gp", + "7z", + "a", + "aac", + "adp", + "ai", + "aif", + "aiff", + "alz", + "ape", + "apk", + "ar", + "arj", + "asf", + "au", + "avi", + "bak", + "baml", + "bh", + "bin", + "bk", + "bmp", + "btif", + "bz2", + "bzip2", + "cab", + "caf", + "cgm", + "class", + "cmx", + "cpio", + "cr2", + "cur", + "dat", + "dcm", + "deb", + "dex", + "djvu", + "dll", + "dmg", + "dng", + "doc", + "docm", + "docx", + "dot", + "dotm", + "dra", + "DS_Store", + "dsk", + "dts", + "dtshd", + "dvb", + "dwg", + "dxf", + "ecelp4800", + "ecelp7470", + "ecelp9600", + "egg", + "eol", + "eot", + "epub", + "exe", + "f4v", + "fbs", + "fh", + "fla", + "flac", + "fli", + "flv", + "fpx", + "fst", + "fvt", + "g3", + "gh", + "gif", + "graffle", + "gz", + "gzip", + "h261", + "h263", + "h264", + "icns", + "ico", + "ief", + "img", + "ipa", + "iso", + "jar", + "jpeg", + "jpg", + "jpgv", + "jpm", + "jxr", + "key", + "ktx", + "lha", + "lib", + "lvp", + "lz", + "lzh", + "lzma", + "lzo", + "m3u", + "m4a", + "m4v", + "mar", + "mdi", + "mht", + "mid", + "midi", + "mj2", + "mka", + "mkv", + "mmr", + "mng", + "mobi", + "mov", + "movie", + "mp3", + "mp4", + "mp4a", + "mpeg", + "mpg", + "mpga", + "mxu", + "nef", + "npx", + "numbers", + "nupkg", + "o", + "oga", + "ogg", + "ogv", + "otf", + "pages", + "pbm", + "pcx", + "pdb", + "pdf", + "pea", + "pgm", + "pic", + "png", + "pnm", + "pot", + "potm", + "potx", + "ppa", + "ppam", + "ppm", + "pps", + "ppsm", + "ppsx", + "ppt", + "pptm", + "pptx", + "psd", + "pya", + "pyc", + "pyo", + "pyv", + "qt", + "rar", + "ras", + "raw", + "resources", + "rgb", + "rip", + "rlc", + "rmf", + "rmvb", + "rtf", + "rz", + "s3m", + "s7z", + "scpt", + "sgi", + "shar", + "sil", + "sketch", + "slk", + "smv", + "snk", + "so", + "stl", + "suo", + "sub", + "swf", + "tar", + "tbz", + "tbz2", + "tga", + "tgz", + "thmx", + "tif", + "tiff", + "tlz", + "ttc", + "ttf", + "txz", + "udf", + "uvh", + "uvi", + "uvm", + "uvp", + "uvs", + "uvu", + "viv", + "vob", + "war", + "wav", + "wax", + "wbmp", + "wdp", + "weba", + "webm", + "webp", + "whl", + "wim", + "wm", + "wma", + "wmv", + "wmx", + "woff", + "woff2", + "wrm", + "wvx", + "xbm", + "xif", + "xla", + "xlam", + "xls", + "xlsb", + "xlsm", + "xlsx", + "xlt", + "xltm", + "xltx", + "xm", + "xmind", + "xpi", + "xpm", + "xwd", + "xz", + "z", + "zip", + "zipx", +) + + +def is_binary_ext_path(filepath) -> bool: + return os.path.splitext(filepath)[1].lstrip(".") in binary_exts diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/_func.py b/venv/lib/python3.10/site-packages/mbstrdecoder/_func.py new file mode 100644 index 0000000000000000000000000000000000000000..c0e31dbecbd167e1426a7b73aaa91a0c63722878 --- /dev/null +++ b/venv/lib/python3.10/site-packages/mbstrdecoder/_func.py @@ -0,0 +1,56 @@ +""" +.. codeauthor:: Tsuyoshi Hombashi +""" + +import os +import stat +from errno import EBADF, ENOENT, ENOTDIR +from typing import Optional, Union + +from ._binary_ext_checker import is_binary_ext_path + + +def is_fifo(file_path: Union[int, bytes, str]) -> bool: + try: + return stat.S_ISFIFO(os.stat(file_path).st_mode) + except OSError as e: + if e.errno not in (ENOENT, ENOTDIR, EBADF): + raise + + return False + except ValueError: + return False + + +def to_codec_name(name: Optional[str]) -> Optional[str]: + if not name: + return None + + return name.lower().replace("-", "_") + + +def detect_file_encoding(file_path) -> Optional[str]: + from chardet.universaldetector import UniversalDetector + + if not os.path.isfile(file_path) or is_binary_ext_path(file_path) or is_fifo(file_path): + return None + + detector = UniversalDetector() + READ_SIZE = 4 * 1024 + + try: + with open(file_path, mode="rb") as f: + while True: + binary = f.read(READ_SIZE) + if not binary: + break + + detector.feed(binary) + if detector.done: + break + except OSError: + return None + finally: + detector.close() + + return to_codec_name(detector.result.get("encoding")) diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/_mbstrdecoder.py b/venv/lib/python3.10/site-packages/mbstrdecoder/_mbstrdecoder.py new file mode 100644 index 0000000000000000000000000000000000000000..1ed86446290bfde7b84da935b8b9b4beb9c38f99 --- /dev/null +++ b/venv/lib/python3.10/site-packages/mbstrdecoder/_mbstrdecoder.py @@ -0,0 +1,291 @@ +""" +.. codeauthor:: Tsuyoshi Hombashi +""" + +import copy +import re +from typing import List, Optional, Sequence + +from ._func import to_codec_name + + +def b(s: str) -> bytes: + return s.encode("latin-1") + + +class MultiByteStrDecoder: + """ + Reference: + https://docs.python.org/3/library/codecs.html + """ + + __CODECS = [ + "utf_7", + "utf_8", + "utf_8_sig", + "utf_16", + "utf_16_be", + "utf_16_le", + "utf_32", + "utf_32_be", + "utf_32_le", + "big5", + "big5hkscs", + "cp037", + "cp424", + "cp437", + "cp500", + "cp720", + "cp737", + "cp775", + "cp850", + "cp852", + "cp855", + "cp856", + "cp857", + "cp858", + "cp860", + "cp861", + "cp862", + "cp863", + "cp864", + "cp865", + "cp866", + "cp869", + "cp874", + "cp875", + "cp932", + "cp949", + "cp950", + "cp1006", + "cp1026", + "cp1140", + "cp1250", + "cp1251", + "cp1252", + "cp1253", + "cp1254", + "cp1255", + "cp1256", + "cp1257", + "cp1258", + "euc_jp", + "euc_jis_2004", + "euc_jisx0213", + "euc_kr", + "gb2312", + "gbk", + "gb18030", + "hz", + "iso2022_jp", + "iso2022_jp_1", + "iso2022_jp_2", + "iso2022_jp_2004", + "iso2022_jp_3", + "iso2022_jp_ext", + "iso2022_kr", + "latin_1", + "iso8859_2", + "iso8859_3", + "iso8859_4", + "iso8859_5", + "iso8859_6", + "iso8859_7", + "iso8859_8", + "iso8859_9", + "iso8859_10", + "iso8859_11", + "iso8859_13", + "iso8859_14", + "iso8859_15", + "iso8859_16", + "johab", + "koi8_r", + "koi8_u", + "mac_cyrillic", + "mac_greek", + "mac_iceland", + "mac_latin2", + "mac_roman", + "mac_turkish", + "ptcp154", + "shift_jis", + "shift_jis_2004", + "shift_jisx0213", + "base64_codec", + "bz2_codec", + "hex_codec", + "idna", + "mbcs", + "palmos", + "punycode", + "quopri_codec", + "raw_unicode_escape", + "rot_13", + "string_escape", + "unicode_escape", + "unicode_internal", + "uu_codec", + "zlib_codec", + ] + __RE_UTF7 = re.compile(b("[+].*?[-]")) + + @property + def unicode_str(self) -> str: + return self.__unicode_str + + @property + def codec(self) -> Optional[str]: + return self.__codec + + def __init__(self, value, codec_candidates: Optional[Sequence[str]] = None) -> None: + self.__encoded_str = value + self.__codec: Optional[str] = None + if codec_candidates is None: + self.__codec_candidate_list: List[str] = [] + else: + self.__codec_candidate_list = list(codec_candidates) + + self.__validate_str() + + self.__unicode_str = self.__to_unicode() + + def __repr__(self) -> str: + return f"codec={self.codec:s}, unicode={self.unicode_str:s}" + + def __validate_str(self) -> None: + if isinstance(self.__encoded_str, (str, bytes)): + return + + raise ValueError(f"value must be a string: actual={type(self.__encoded_str)}") + + def __is_buffer(self) -> bool: + return isinstance(self.__encoded_str, memoryview) + + def __is_multibyte_utf7(self, encoded_str) -> bool: + if self.__codec != "utf_7": + return False + + utf7_symbol_count = encoded_str.count(b("+")) + if utf7_symbol_count <= 0: + return False + + if utf7_symbol_count != encoded_str.count(b("-")): + return False + + return utf7_symbol_count == len(self.__RE_UTF7.findall(encoded_str)) + + def __get_encoded_str(self) -> str: + if self.__is_buffer(): + return str(self.__encoded_str) + + return self.__encoded_str + + @staticmethod + def __detect_encoding_helper(encoded_str) -> Optional[str]: + import chardet + + try: + detect = chardet.detect(encoded_str) + except TypeError: + detect = {} # type: ignore + + detect_encoding = detect.get("encoding") + confidence = detect.get("confidence") + + if detect_encoding not in ["ascii", "utf-8"] and confidence and confidence > 0.7: + # utf7 tend to be misrecognized as ascii + return detect_encoding + + return None + + def __get_codec_candidate_list(self, encoded_str) -> List[str]: + codec_candidate_list = copy.deepcopy(self.__CODECS) + detect_encoding = self.__detect_encoding_helper(encoded_str) + + if detect_encoding: + try: + codec_candidate_list.remove(detect_encoding) + except ValueError: + pass + + codec_candidate_list.insert(0, detect_encoding) + + for codec_candidate in self.__codec_candidate_list: + try: + codec_candidate_list.remove(codec_candidate) + except ValueError: + pass + + return self.__codec_candidate_list + codec_candidate_list + + def __to_unicode(self): + encoded_str = self.__get_encoded_str() + + if encoded_str == b"": + self.__codec = "unicode" + return "" + + for codec in self.__get_codec_candidate_list(encoded_str): + if not codec: + continue + + try: + self.__codec = to_codec_name(codec) + decoded_str = encoded_str.decode(codec) + break + except UnicodeDecodeError: + self.__codec = None + continue + except AttributeError: + if isinstance(encoded_str, str): + # already a unicode string (python 3) + self.__codec = "unicode" + + if not encoded_str: + return encoded_str + + return encoded_str + + self.__codec = None + + try: + return f"{encoded_str}" + except UnicodeDecodeError: + # some of the objects that cannot convertible to a string + # may reach this line + raise TypeError("argument must be a string") + else: + self.__codec = None + + try: + message = f"unknown codec: encoded_str={encoded_str}" + except UnicodeDecodeError: + message = f"unknown codec: value-type={type(encoded_str)}" + + raise UnicodeDecodeError(message) + + if self.codec == "utf_7": + return self.__process_utf7(encoded_str, decoded_str) + + return decoded_str + + def __process_utf7(self, encoded_str, decoded_str) -> str: + if not encoded_str: + self.__codec = "unicode" + + return encoded_str + + if self.__is_multibyte_utf7(encoded_str): + try: + decoded_str.encode("ascii") + + self.__codec = "ascii" + + return encoded_str.decode("ascii") + except UnicodeEncodeError: + return decoded_str + + self.__codec = "ascii" + + return encoded_str.decode("ascii") diff --git a/venv/lib/python3.10/site-packages/mbstrdecoder/py.typed b/venv/lib/python3.10/site-packages/mbstrdecoder/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/__init__.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e02d46ec4c3543a767ecedbcd99e6deec95f0b6 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/__init__.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/__version__.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/__version__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8409513bd7667f8cedf3a37f0880cd86321b4ec8 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/__version__.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_base.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_base.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b5bcc8274bae801be481fdf529dc83eff28de13 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_base.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_common.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_common.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b72c3ce135db8f9f361369fe120a0babef7bc56e Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_common.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_const.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_const.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6f69420dcf07fe1b155d6604ced68172597e343 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_const.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_filename.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_filename.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f39c6a4699080fd7fd02f3bc68823b5ac52851c9 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_filename.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_filepath.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_filepath.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..34322da0d321a53ac73f3395562d4f3325e5a7be Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_filepath.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_ltsv.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_ltsv.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..80814918ac6ea89524056c1f68473e2339731a20 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_ltsv.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_symbol.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_symbol.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6139c757b56c3f20912a495e0b4583b8abf06b23 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_symbol.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_types.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_types.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e97e579d30dd872b7fdafed98dd3125066915056 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/_types.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/argparse.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/argparse.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d2968cb49664bd3b574695bcae67aeb79153264 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/argparse.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/click.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/click.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..34f1f3d6f12bd195db1798c9374dfb8743ef116a Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/click.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/error.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/error.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d4ca9b9efa2e8516628ea0968e47cce6316a51f Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/error.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/handler.cpython-310.pyc b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/handler.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0889379d2901c94c1f3ed7b2fc85ff92c03e4da0 Binary files /dev/null and b/venv/lib/python3.10/site-packages/pathvalidate/__pycache__/handler.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/pathvalidate/__version__.py b/venv/lib/python3.10/site-packages/pathvalidate/__version__.py new file mode 100644 index 0000000000000000000000000000000000000000..7359321cede8ecec1c85b17c509a41966fe649a2 --- /dev/null +++ b/venv/lib/python3.10/site-packages/pathvalidate/__version__.py @@ -0,0 +1,6 @@ +__author__ = "Tsuyoshi Hombashi" +__copyright__ = f"Copyright 2016, {__author__}" +__license__ = "MIT License" +__version__ = "3.2.0" +__maintainer__ = __author__ +__email__ = "tsuyoshi.hombashi@gmail.com" diff --git a/venv/lib/python3.10/site-packages/pathvalidate/error.py b/venv/lib/python3.10/site-packages/pathvalidate/error.py new file mode 100644 index 0000000000000000000000000000000000000000..ee75600b85d5b5938cb0942c206b0b63134f3097 --- /dev/null +++ b/venv/lib/python3.10/site-packages/pathvalidate/error.py @@ -0,0 +1,253 @@ +""" +.. codeauthor:: Tsuyoshi Hombashi +""" + +import enum +from typing import Dict, Optional + +from ._const import Platform + + +def _to_error_code(code: int) -> str: + return f"PV{code:04d}" + + +class ErrorAttrKey: + BYTE_COUNT = "byte_count" + DESCRIPTION = "description" + FS_ENCODING = "fs_encoding" + PLATFORM = "platform" + REASON = "reason" + RESERVED_NAME = "reserved_name" + REUSABLE_NAME = "reusable_name" + + +@enum.unique +class ErrorReason(enum.Enum): + """ + Validation error reasons. + """ + + NULL_NAME = (_to_error_code(1001), "NULL_NAME", "the value must not be an empty") + RESERVED_NAME = ( + _to_error_code(1002), + "RESERVED_NAME", + "found a reserved name by a platform", + ) + INVALID_CHARACTER = ( + _to_error_code(1100), + "INVALID_CHARACTER", + "invalid characters found", + ) + INVALID_LENGTH = ( + _to_error_code(1101), + "INVALID_LENGTH", + "found an invalid string length", + ) + FOUND_ABS_PATH = ( + _to_error_code(1200), + "FOUND_ABS_PATH", + "found an absolute path where must be a relative path", + ) + MALFORMED_ABS_PATH = ( + _to_error_code(1201), + "MALFORMED_ABS_PATH", + "found a malformed absolute path", + ) + INVALID_AFTER_SANITIZE = ( + _to_error_code(2000), + "INVALID_AFTER_SANITIZE", + "found invalid value after sanitizing", + ) + + @property + def code(self) -> str: + """str: Error code.""" + return self.__code + + @property + def name(self) -> str: + """str: Error reason name.""" + return self.__name + + @property + def description(self) -> str: + """str: Error reason description.""" + return self.__description + + def __init__(self, code: str, name: str, description: str) -> None: + self.__name = name + self.__code = code + self.__description = description + + def __str__(self) -> str: + return f"[{self.__code}] {self.__description}" + + +class ValidationError(ValueError): + """ + Exception class of validation errors. + """ + + @property + def platform(self) -> Optional[Platform]: + """ + :py:class:`~pathvalidate.Platform`: Platform information. + """ + return self.__platform + + @property + def reason(self) -> ErrorReason: + """ + :py:class:`~pathvalidate.error.ErrorReason`: The cause of the error. + """ + return self.__reason + + @property + def description(self) -> Optional[str]: + """Optional[str]: Error description.""" + return self.__description + + @property + def reserved_name(self) -> str: + """str: Reserved name.""" + return self.__reserved_name + + @property + def reusable_name(self) -> Optional[bool]: + """Optional[bool]: Whether the name is reusable or not.""" + return self.__reusable_name + + @property + def fs_encoding(self) -> Optional[str]: + """Optional[str]: File system encoding.""" + return self.__fs_encoding + + @property + def byte_count(self) -> Optional[int]: + """Optional[int]: Byte count of the path.""" + return self.__byte_count + + def __init__(self, *args, **kwargs) -> None: # type: ignore + if ErrorAttrKey.REASON not in kwargs: + raise ValueError(f"{ErrorAttrKey.REASON} must be specified") + + self.__reason: ErrorReason = kwargs.pop(ErrorAttrKey.REASON) + self.__byte_count: Optional[int] = kwargs.pop(ErrorAttrKey.BYTE_COUNT, None) + self.__platform: Optional[Platform] = kwargs.pop(ErrorAttrKey.PLATFORM, None) + self.__description: Optional[str] = kwargs.pop(ErrorAttrKey.DESCRIPTION, None) + self.__reserved_name: str = kwargs.pop(ErrorAttrKey.RESERVED_NAME, "") + self.__reusable_name: Optional[bool] = kwargs.pop(ErrorAttrKey.REUSABLE_NAME, None) + self.__fs_encoding: Optional[str] = kwargs.pop(ErrorAttrKey.FS_ENCODING, None) + + try: + super().__init__(*args[0], **kwargs) + except IndexError: + super().__init__(*args, **kwargs) + + def as_slog(self) -> Dict[str, str]: + """Return a dictionary representation of the error. + + Returns: + Dict[str, str]: A dictionary representation of the error. + """ + + slog: Dict[str, str] = { + "code": self.reason.code, + ErrorAttrKey.DESCRIPTION: self.reason.description, + } + if self.platform: + slog[ErrorAttrKey.PLATFORM] = self.platform.value + if self.description: + slog[ErrorAttrKey.DESCRIPTION] = self.description + if self.__reusable_name is not None: + slog[ErrorAttrKey.REUSABLE_NAME] = str(self.__reusable_name) + if self.__fs_encoding: + slog[ErrorAttrKey.FS_ENCODING] = self.__fs_encoding + if self.__byte_count: + slog[ErrorAttrKey.BYTE_COUNT] = str(self.__byte_count) + + return slog + + def __str__(self) -> str: + item_list = [] + header = str(self.reason) + + if Exception.__str__(self): + item_list.append(Exception.__str__(self)) + + if self.platform: + item_list.append(f"{ErrorAttrKey.PLATFORM}={self.platform.value}") + if self.description: + item_list.append(f"{ErrorAttrKey.DESCRIPTION}={self.description}") + if self.__reusable_name is not None: + item_list.append(f"{ErrorAttrKey.REUSABLE_NAME}={self.reusable_name}") + if self.__fs_encoding: + item_list.append(f"{ErrorAttrKey.FS_ENCODING}={self.__fs_encoding}") + if self.__byte_count is not None: + item_list.append(f"{ErrorAttrKey.BYTE_COUNT}={self.__byte_count:,d}") + + if item_list: + header += ": " + + return header + ", ".join(item_list).strip() + + def __repr__(self) -> str: + return self.__str__() + + +class NullNameError(ValidationError): + """[Deprecated] + Exception raised when a name is empty. + """ + + def __init__(self, *args, **kwargs) -> None: # type: ignore + kwargs[ErrorAttrKey.REASON] = ErrorReason.NULL_NAME + + super().__init__(args, **kwargs) + + +class InvalidCharError(ValidationError): + """ + Exception raised when includes invalid character(s) within a string. + """ + + def __init__(self, *args, **kwargs) -> None: # type: ignore[no-untyped-def] + kwargs[ErrorAttrKey.REASON] = ErrorReason.INVALID_CHARACTER + + super().__init__(args, **kwargs) + + +class ReservedNameError(ValidationError): + """ + Exception raised when a string matched a reserved name. + """ + + def __init__(self, *args, **kwargs) -> None: # type: ignore[no-untyped-def] + kwargs[ErrorAttrKey.REASON] = ErrorReason.RESERVED_NAME + + super().__init__(args, **kwargs) + + +class ValidReservedNameError(ReservedNameError): + """[Deprecated] + Exception raised when a string matched a reserved name. + However, it can be used as a name. + """ + + def __init__(self, *args, **kwargs) -> None: # type: ignore[no-untyped-def] + kwargs[ErrorAttrKey.REUSABLE_NAME] = True + + super().__init__(args, **kwargs) + + +class InvalidReservedNameError(ReservedNameError): + """[Deprecated] + Exception raised when a string matched a reserved name. + Moreover, the reserved name is invalid as a name. + """ + + def __init__(self, *args, **kwargs) -> None: # type: ignore[no-untyped-def] + kwargs[ErrorAttrKey.REUSABLE_NAME] = False + + super().__init__(args, **kwargs) diff --git a/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/INSTALLER b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/LICENSE b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64 --- /dev/null +++ b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/METADATA b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..fff5008e36be4ff7d4994d6f84c62e89c8b1ac8e --- /dev/null +++ b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/METADATA @@ -0,0 +1,212 @@ +Metadata-Version: 2.1 +Name: peft +Version: 0.10.0 +Summary: Parameter-Efficient Fine-Tuning (PEFT) +Home-page: https://github.com/huggingface/peft +Author: The HuggingFace team +Author-email: sourab@huggingface.co +License: Apache +Keywords: deep learning +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Education +Classifier: Intended Audience :: Science/Research +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence +Requires-Python: >=3.8.0 +Description-Content-Type: text/markdown +License-File: LICENSE +Requires-Dist: numpy (>=1.17) +Requires-Dist: packaging (>=20.0) +Requires-Dist: psutil +Requires-Dist: pyyaml +Requires-Dist: torch (>=1.13.0) +Requires-Dist: transformers +Requires-Dist: tqdm +Requires-Dist: accelerate (>=0.21.0) +Requires-Dist: safetensors +Requires-Dist: huggingface-hub (>=0.17.0) +Provides-Extra: dev +Requires-Dist: black ; extra == 'dev' +Requires-Dist: hf-doc-builder ; extra == 'dev' +Requires-Dist: ruff (~=0.2.1) ; extra == 'dev' +Provides-Extra: docs_specific +Requires-Dist: black ; extra == 'docs_specific' +Requires-Dist: hf-doc-builder ; extra == 'docs_specific' +Provides-Extra: quality +Requires-Dist: black ; extra == 'quality' +Requires-Dist: hf-doc-builder ; extra == 'quality' +Requires-Dist: ruff (~=0.2.1) ; extra == 'quality' +Provides-Extra: test +Requires-Dist: black ; extra == 'test' +Requires-Dist: hf-doc-builder ; extra == 'test' +Requires-Dist: ruff (~=0.2.1) ; extra == 'test' +Requires-Dist: pytest ; extra == 'test' +Requires-Dist: pytest-cov ; extra == 'test' +Requires-Dist: pytest-xdist ; extra == 'test' +Requires-Dist: parameterized ; extra == 'test' +Requires-Dist: datasets ; extra == 'test' +Requires-Dist: diffusers (<0.21.0) ; extra == 'test' +Requires-Dist: scipy ; extra == 'test' + + + +

🤗 PEFT

+

+

State-of-the-art Parameter-Efficient Fine-Tuning (PEFT) methods

+

+ +Fine-tuning large pretrained models is often prohibitively costly due to their scale. Parameter-Efficient Fine-Tuning (PEFT) methods enable efficient adaptation of large pretrained models to various downstream applications by only fine-tuning a small number of (extra) model parameters instead of all the model's parameters. This significantly decreases the computational and storage costs. Recent state-of-the-art PEFT techniques achieve performance comparable to fully fine-tuned models. + +PEFT is integrated with Transformers for easy model training and inference, Diffusers for conveniently managing different adapters, and Accelerate for distributed training and inference for really big models. + +> [!TIP] +> Visit the [PEFT](https://huggingface.co/PEFT) organization to read about the PEFT methods implemented in the library and to see notebooks demonstrating how to apply these methods to a variety of downstream tasks. Click the "Watch repos" button on the organization page to be notified of newly implemented methods and notebooks! + +Check the PEFT Adapters API Reference section for a list of supported PEFT methods, and read the [Adapters](https://huggingface.co/docs/peft/en/conceptual_guides/adapter), [Soft prompts](https://huggingface.co/docs/peft/en/conceptual_guides/prompting), and [IA3](https://huggingface.co/docs/peft/en/conceptual_guides/ia3) conceptual guides to learn more about how these methods work. + +## Quickstart + +Install PEFT from pip: + +```bash +pip install peft +``` + +Prepare a model for training with a PEFT method such as LoRA by wrapping the base model and PEFT configuration with `get_peft_model`. For the bigscience/mt0-large model, you're only training 0.19% of the parameters! + +```python +from transformers import AutoModelForSeq2SeqLM +from peft import get_peft_config, get_peft_model, LoraConfig, TaskType +model_name_or_path = "bigscience/mt0-large" +tokenizer_name_or_path = "bigscience/mt0-large" + +peft_config = LoraConfig( + task_type=TaskType.SEQ_2_SEQ_LM, inference_mode=False, r=8, lora_alpha=32, lora_dropout=0.1 +) + +model = AutoModelForSeq2SeqLM.from_pretrained(model_name_or_path) +model = get_peft_model(model, peft_config) +model.print_trainable_parameters() +"trainable params: 2359296 || all params: 1231940608 || trainable%: 0.19151053100118282" +``` + +To load a PEFT model for inference: + +```py +from peft import AutoPeftModelForCausalLM +from transformers import AutoTokenizer +import torch + +model = AutoPeftModelForCausalLM.from_pretrained("ybelkada/opt-350m-lora").to("cuda") +tokenizer = AutoTokenizer.from_pretrained("facebook/opt-350m") + +model.eval() +inputs = tokenizer("Preheat the oven to 350 degrees and place the cookie dough", return_tensors="pt") + +outputs = model.generate(input_ids=inputs["input_ids"].to("cuda"), max_new_tokens=50) +print(tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]) + +"Preheat the oven to 350 degrees and place the cookie dough in the center of the oven. In a large bowl, combine the flour, baking powder, baking soda, salt, and cinnamon. In a separate bowl, combine the egg yolks, sugar, and vanilla." +``` + +## Why you should use PEFT + +There are many benefits of using PEFT but the main one is the huge savings in compute and storage, making PEFT applicable to many different use cases. + +### High performance on consumer hardware + +Consider the memory requirements for training the following models on the [ought/raft/twitter_complaints](https://huggingface.co/datasets/ought/raft/viewer/twitter_complaints) dataset with an A100 80GB GPU with more than 64GB of CPU RAM. + +| Model | Full Finetuning | PEFT-LoRA PyTorch | PEFT-LoRA DeepSpeed with CPU Offloading | +| --------- | ---- | ---- | ---- | +| bigscience/T0_3B (3B params) | 47.14GB GPU / 2.96GB CPU | 14.4GB GPU / 2.96GB CPU | 9.8GB GPU / 17.8GB CPU | +| bigscience/mt0-xxl (12B params) | OOM GPU | 56GB GPU / 3GB CPU | 22GB GPU / 52GB CPU | +| bigscience/bloomz-7b1 (7B params) | OOM GPU | 32GB GPU / 3.8GB CPU | 18.1GB GPU / 35GB CPU | + +With LoRA you can fully finetune a 12B parameter model that would've otherwise run out of memory on the 80GB GPU, and comfortably fit and train a 3B parameter model. When you look at the 3B parameter model's performance, it is comparable to a fully finetuned model at a fraction of the GPU memory. + +| Submission Name | Accuracy | +| --------- | ---- | +| Human baseline (crowdsourced) | 0.897 | +| Flan-T5 | 0.892 | +| lora-t0-3b | 0.863 | + +> [!TIP] +> The bigscience/T0_3B model performance isn't optimized in the table above. You can squeeze even more performance out of it by playing around with the input instruction templates, LoRA hyperparameters, and other training related hyperparameters. The final checkpoint size of this model is just 19MB compared to 11GB of the full bigscience/T0_3B model. Learn more about the advantages of finetuning with PEFT in this [blog post](https://www.philschmid.de/fine-tune-flan-t5-peft). + +### Quantization + +Quantization is another method for reducing the memory requirements of a model by representing the data in a lower precision. It can be combined with PEFT methods to make it even easier to train and load LLMs for inference. + +* Learn how to finetune [meta-llama/Llama-2-7b-hf](https://huggingface.co/meta-llama/Llama-2-7b-hf) with QLoRA and the [TRL](https://huggingface.co/docs/trl/index) library on a 16GB GPU in the [Finetune LLMs on your own consumer hardware using tools from PyTorch and Hugging Face ecosystem](https://pytorch.org/blog/finetune-llms/) blog post. +* Learn how to finetune a [openai/whisper-large-v2](https://huggingface.co/openai/whisper-large-v2) model for multilingual automatic speech recognition with LoRA and 8-bit quantization in this [notebook](https://colab.research.google.com/drive/1DOkD_5OUjFa0r5Ik3SgywJLJtEo2qLxO?usp=sharing) (see this [notebook](https://colab.research.google.com/drive/1vhF8yueFqha3Y3CpTHN6q9EVcII9EYzs?usp=sharing) instead for an example of streaming a dataset). + +### Save compute and storage + +PEFT can help you save storage by avoiding full finetuning of models on each of downstream task or dataset. In many cases, you're only finetuning a very small fraction of a model's parameters and each checkpoint is only a few MBs in size (instead of GBs). These smaller PEFT adapters demonstrate performance comparable to a fully finetuned model. If you have many datasets, you can save a lot of storage with a PEFT model and not have to worry about catastrophic forgetting or overfitting the backbone or base model. + +## PEFT integrations + +PEFT is widely supported across the Hugging Face ecosystem because of the massive efficiency it brings to training and inference. + +### Diffusers + +The iterative diffusion process consumes a lot of memory which can make it difficult to train. PEFT can help reduce the memory requirements and reduce the storage size of the final model checkpoint. For example, consider the memory required for training a Stable Diffusion model with LoRA on an A100 80GB GPU with more than 64GB of CPU RAM. The final model checkpoint size is only 8.8MB! + +| Model | Full Finetuning | PEFT-LoRA | PEFT-LoRA with Gradient Checkpointing | +| --------- | ---- | ---- | ---- | +| CompVis/stable-diffusion-v1-4 | 27.5GB GPU / 3.97GB CPU | 15.5GB GPU / 3.84GB CPU | 8.12GB GPU / 3.77GB CPU | + +> [!TIP] +> Take a look at the [examples/lora_dreambooth/train_dreambooth.py](examples/lora_dreambooth/train_dreambooth.py) training script to try training your own Stable Diffusion model with LoRA, and play around with the [smangrul/peft-lora-sd-dreambooth](https://huggingface.co/spaces/smangrul/peft-lora-sd-dreambooth) Space which is running on a T4 instance. Learn more about the PEFT integration in Diffusers in this [tutorial](https://huggingface.co/docs/peft/main/en/tutorial/peft_integrations#diffusers). + +### Accelerate + +[Accelerate](https://huggingface.co/docs/accelerate/index) is a library for distributed training and inference on various training setups and hardware (GPUs, TPUs, Apple Silicon, etc.). PEFT models work with Accelerate out of the box, making it really convenient to train really large models or use them for inference on consumer hardware with limited resources. + +### TRL + +PEFT can also be applied to training LLMs with RLHF components such as the ranker and policy. Get started by reading: + +* [Fine-tune a Mistral-7b model with Direct Preference Optimization](https://towardsdatascience.com/fine-tune-a-mistral-7b-model-with-direct-preference-optimization-708042745aac) with PEFT and the [TRL](https://huggingface.co/docs/trl/index) library to learn more about the Direct Preference Optimization (DPO) method and how to apply it to a LLM. +* [Fine-tuning 20B LLMs with RLHF on a 24GB consumer GPU](https://huggingface.co/blog/trl-peft) with PEFT and the [TRL](https://huggingface.co/docs/trl/index) library, and then try out the [gpt2-sentiment_peft.ipynb](https://github.com/huggingface/trl/blob/main/examples/notebooks/gpt2-sentiment.ipynb) notebook to optimize GPT2 to generate positive movie reviews. +* [StackLLaMA: A hands-on guide to train LLaMA with RLHF](https://huggingface.co/blog/stackllama) with PEFT, and then try out the [stack_llama/scripts](https://github.com/huggingface/trl/tree/main/examples/research_projects/stack_llama/scripts) for supervised finetuning, reward modeling, and RL finetuning. + +## Model support + +Use this [Space](https://stevhliu-peft-methods.hf.space) or check out the [docs](https://huggingface.co/docs/peft/main/en/index) to find which models officially support a PEFT method out of the box. Even if you don't see a model listed below, you can manually configure the model config to enable PEFT for a model. Read the [New transformers architecture](https://huggingface.co/docs/peft/main/en/developer_guides/custom_models#new-transformers-architectures) guide to learn how. + +## Contribute + +If you would like to contribute to PEFT, please check out our [contribution guide](https://huggingface.co/docs/peft/developer_guides/contributing). + +## Citing 🤗 PEFT + +To use 🤗 PEFT in your publication, please cite it by using the following BibTeX entry. + +```bibtex +@Misc{peft, + title = {PEFT: State-of-the-art Parameter-Efficient Fine-Tuning methods}, + author = {Sourab Mangrulkar and Sylvain Gugger and Lysandre Debut and Younes Belkada and Sayak Paul and Benjamin Bossan}, + howpublished = {\url{https://github.com/huggingface/peft}}, + year = {2022} +} +``` diff --git a/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/RECORD b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..d8a9ed582072de582eb8b79a65d99d2b4da41700 --- /dev/null +++ b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/RECORD @@ -0,0 +1,157 @@ +peft-0.10.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +peft-0.10.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357 +peft-0.10.0.dist-info/METADATA,sha256=rVMHyukd8k_nEqs19E5ZPaco9GqrkHrI1m6LGW3ZTc4,13215 +peft-0.10.0.dist-info/RECORD,, +peft-0.10.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92 +peft-0.10.0.dist-info/top_level.txt,sha256=DOKoqHe6fr-A3g26PPWvf5bHLy8fHKhflUO5xzJJEUY,5 +peft/__init__.py,sha256=kL2rBDEEvPAJ2CpnXnwOa5IXylk9a7KRTJXSAedS6ZE,2514 +peft/__pycache__/__init__.cpython-310.pyc,, +peft/__pycache__/auto.cpython-310.pyc,, +peft/__pycache__/config.cpython-310.pyc,, +peft/__pycache__/helpers.cpython-310.pyc,, +peft/__pycache__/import_utils.cpython-310.pyc,, +peft/__pycache__/mapping.cpython-310.pyc,, +peft/__pycache__/mixed_model.cpython-310.pyc,, +peft/__pycache__/peft_model.cpython-310.pyc,, +peft/auto.py,sha256=03OkfIQ_xhziupLLVP5wFYt8pmMOxwjCD5ik1vuNHVk,6568 +peft/config.py,sha256=W6kNwSDRySZyV_1tBkQzim6PMmM6s4VAQCd8d__Q_fE,10908 +peft/helpers.py,sha256=ycZIsMacCi_-WLhsQsWsiweFr3iS8EIVIBDYfcQYBc0,4423 +peft/import_utils.py,sha256=PefA5udnA0LhTOjLvsPsLuDIOQsbvdtm_klzxsNUmAA,2382 +peft/mapping.py,sha256=e7Ei7fcLwVNAuiiZmbitmifqvKTrusnQkd1nzdQh-Vs,5916 +peft/mixed_model.py,sha256=swX0HCZedYXDPASwTqdNn3FGBhzqhRCWRKdHDLg6pV4,16572 +peft/peft_model.py,sha256=kWt8pvOAzFsv4D8uMh1B8jmkA0PEAlSDpf5hul8KxMQ,89505 +peft/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +peft/tuners/__init__.py,sha256=N75esatM3Zuf1BmfjWqnCQSv-IevaNtKsWanFPMzq8g,1535 +peft/tuners/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/__pycache__/lycoris_utils.cpython-310.pyc,, +peft/tuners/__pycache__/tuners_utils.cpython-310.pyc,, +peft/tuners/adalora/__init__.py,sha256=iT-UeicKex8znLIwoOr642odMVues4KZneN_e1Hz6MQ,1298 +peft/tuners/adalora/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/adalora/__pycache__/bnb.cpython-310.pyc,, +peft/tuners/adalora/__pycache__/config.cpython-310.pyc,, +peft/tuners/adalora/__pycache__/gptq.cpython-310.pyc,, +peft/tuners/adalora/__pycache__/layer.cpython-310.pyc,, +peft/tuners/adalora/__pycache__/model.cpython-310.pyc,, +peft/tuners/adalora/bnb.py,sha256=QZeSa84I564wHq-PjNKiX3IUWi9jYW1t_AlVxroNhCs,5606 +peft/tuners/adalora/config.py,sha256=P0yXBb0OfTXEUrgfqCkVauAVIOm4Q8UfCNlgt4mdY2Q,2659 +peft/tuners/adalora/gptq.py,sha256=nsehwVjP9e1H6rXwuS3dID8lqEQbRXK98Hogzsm8MeE,2719 +peft/tuners/adalora/layer.py,sha256=z6dXGLNNastpo0xZWoX83R9lNxOwJJRehbhdx6KUhZM,14352 +peft/tuners/adalora/model.py,sha256=XqcyNkxUfXwAz60QnMK60gfXhE-ZhgKUXUpCHbDYlko,15302 +peft/tuners/adaption_prompt/__init__.py,sha256=gOenS_7j87CTvgb_xPaW2K8-PfVwHndb3EHdofV3BGU,794 +peft/tuners/adaption_prompt/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/adaption_prompt/__pycache__/config.cpython-310.pyc,, +peft/tuners/adaption_prompt/__pycache__/layer.cpython-310.pyc,, +peft/tuners/adaption_prompt/__pycache__/model.cpython-310.pyc,, +peft/tuners/adaption_prompt/__pycache__/utils.cpython-310.pyc,, +peft/tuners/adaption_prompt/config.py,sha256=_wECOCgJBVEg1YDOqpuMt6Glo3OglFwdHfsnfQJZdms,2803 +peft/tuners/adaption_prompt/layer.py,sha256=GCBW_2eEGmUOZS_FyQ-HgbbWOJkCLCKq89B3quKTKLs,5833 +peft/tuners/adaption_prompt/model.py,sha256=wUcz0G8UBXCchOWP14zj-iKbbd707WR-ti6wj60vuck,7464 +peft/tuners/adaption_prompt/utils.py,sha256=W9qL4LLgwyM0jMcSvQOy1DzEzADVRzL61Gh9Hx_rRvw,5708 +peft/tuners/ia3/__init__.py,sha256=72N2yY-5xQRq5cxmxLkm73JwNF3AZUhG8hdJ4g834uU,1185 +peft/tuners/ia3/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/ia3/__pycache__/bnb.cpython-310.pyc,, +peft/tuners/ia3/__pycache__/config.cpython-310.pyc,, +peft/tuners/ia3/__pycache__/layer.cpython-310.pyc,, +peft/tuners/ia3/__pycache__/model.cpython-310.pyc,, +peft/tuners/ia3/bnb.py,sha256=GvoVKQS0t4u5Xnq-isEMLi8m_VgZdBZPc6LrVEZdHkM,4668 +peft/tuners/ia3/config.py,sha256=K27xLoIIo_meHt--iE9H-kfmLUycXNP2eV2cBQJKERE,5152 +peft/tuners/ia3/layer.py,sha256=4CMLwAKN4N2dvuWeabVmRxqAAoqznHnYcEdUrMYLrEI,13661 +peft/tuners/ia3/model.py,sha256=5wL76PXcMV197yH7u0Sa1L3zCjTVWEvSN0VFysG34fo,16597 +peft/tuners/loha/__init__.py,sha256=lHzf9_TXvsqW6SCVnMjeMsgqD6Vdv8c6L2Ob6joeoio,777 +peft/tuners/loha/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/loha/__pycache__/config.cpython-310.pyc,, +peft/tuners/loha/__pycache__/layer.cpython-310.pyc,, +peft/tuners/loha/__pycache__/model.cpython-310.pyc,, +peft/tuners/loha/config.py,sha256=aKe2JegDgAj4l9oV-SQr1UWo80LivP45jM35fpXOEfc,6037 +peft/tuners/loha/layer.py,sha256=BtPrDc1NtpcYj2_NW0s25lC4S--jVvMFyVwBnURCBFM,15606 +peft/tuners/loha/model.py,sha256=boeR0HwZu8F1EJEM1zb7gs5jaAKO_aKXu1TsIUwDuH8,4205 +peft/tuners/lokr/__init__.py,sha256=s8o_tkrdXpN7ZUXEMUoFxXxmg8_Fj9pRHlDqn16Ie8c,777 +peft/tuners/lokr/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/lokr/__pycache__/config.cpython-310.pyc,, +peft/tuners/lokr/__pycache__/layer.cpython-310.pyc,, +peft/tuners/lokr/__pycache__/model.cpython-310.pyc,, +peft/tuners/lokr/config.py,sha256=OworzmruIz37l3BsQ0C-7sULL7Es4AUMuKbK_wWvjrk,6305 +peft/tuners/lokr/layer.py,sha256=D8VJ6MXnexS6ieFvXGciJObj_NMjPvHG1-7zrDBc1Tk,15469 +peft/tuners/lokr/model.py,sha256=s6OMs72nQJXZnDSjQW3HX9UrprktIP0p61l2ymsZgQY,4259 +peft/tuners/lora/__init__.py,sha256=3J6qLQHY9iZbkJ5bgD0uDUtXicIn4cDQi8z5lnjTF4s,1288 +peft/tuners/lora/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/lora/__pycache__/aqlm.cpython-310.pyc,, +peft/tuners/lora/__pycache__/awq.cpython-310.pyc,, +peft/tuners/lora/__pycache__/bnb.cpython-310.pyc,, +peft/tuners/lora/__pycache__/config.cpython-310.pyc,, +peft/tuners/lora/__pycache__/gptq.cpython-310.pyc,, +peft/tuners/lora/__pycache__/layer.cpython-310.pyc,, +peft/tuners/lora/__pycache__/model.cpython-310.pyc,, +peft/tuners/lora/__pycache__/tp_layer.cpython-310.pyc,, +peft/tuners/lora/aqlm.py,sha256=jqxOpFyTIOtRJJe5YzcF0vxIPSUdEW4kAvnzkollhS4,3320 +peft/tuners/lora/awq.py,sha256=Y7_sgl3WorxAtppyCuzLmCH62FaW_IQE6RwQ_YoH4PA,3693 +peft/tuners/lora/bnb.py,sha256=fFfpehst9kRqQR2xBF2o6dCLmxIIaiHVMFXO-rLCsH4,22415 +peft/tuners/lora/config.py,sha256=02hCQLNna2kD8p5PxdTKx1TpwUuZj0hqWeOm8GAoacI,17322 +peft/tuners/lora/gptq.py,sha256=dMFl7H157DkHVD7sjX9BE8nUGdMXQG46VUqn5wYWn6o,3969 +peft/tuners/lora/layer.py,sha256=sK10nz2sUO8YMKrOue48-Ey7qjlNPRpGaoEFnCCKcNo,47596 +peft/tuners/lora/model.py,sha256=E2bSxGxK-tRkEhcM969fg-5Wf5BTH7QlEKPNDsDHvpo,34612 +peft/tuners/lora/tp_layer.py,sha256=xfvluzH_7D5cPicodHJPILNvpPL4F2Qpfi5SOaH1GmM,8829 +peft/tuners/lycoris_utils.py,sha256=JAL2tBhcYTHy8V74TGEKXceTxlAIhWa21xFH800av70,16629 +peft/tuners/mixed/__init__.py,sha256=see7CbOiJJ-E8W1QSSBtIK4oQfFnkJOUVU5xckCYyzw,706 +peft/tuners/mixed/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/mixed/__pycache__/model.cpython-310.pyc,, +peft/tuners/mixed/model.py,sha256=eLqWsKvNcTii3Kgcbqnp2jv4_LtQwixRJd9Ayn_vDhA,15006 +peft/tuners/multitask_prompt_tuning/__init__.py,sha256=_Vm3xHt9URAAAYg_XtA-dWJC-vsNs39hW8Bntym3L-I,819 +peft/tuners/multitask_prompt_tuning/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/multitask_prompt_tuning/__pycache__/config.cpython-310.pyc,, +peft/tuners/multitask_prompt_tuning/__pycache__/model.cpython-310.pyc,, +peft/tuners/multitask_prompt_tuning/config.py,sha256=5G9MbSB9m2DCxhwYE5RZ6ZvSfQvt641k_PBz7XA3Ac8,2446 +peft/tuners/multitask_prompt_tuning/model.py,sha256=GczbBvzlm_VKrRrB1I-MW9Exm6S9-hQIGCdA5me2eoU,4659 +peft/tuners/oft/__init__.py,sha256=B9DhFqanuJW0VSZa9Fwe-lUBw4UczAv3BvsQaKu8whE,771 +peft/tuners/oft/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/oft/__pycache__/config.cpython-310.pyc,, +peft/tuners/oft/__pycache__/layer.cpython-310.pyc,, +peft/tuners/oft/__pycache__/model.cpython-310.pyc,, +peft/tuners/oft/config.py,sha256=mLSje1UnT2Aor1R7miKsKCKKMeQPc8vUC3SBUCkw4EE,5826 +peft/tuners/oft/layer.py,sha256=cWfJguXCVTzworW8XW9ndp54iSVLrPUVMoTmQ2PZoiM,15591 +peft/tuners/oft/model.py,sha256=DJzJIrKd0MGqCpoNQXSstC5cfACsXt6IK4C8y8Rc-yg,3695 +peft/tuners/p_tuning/__init__.py,sha256=XUQbMT5GTftYRCGNkWiWfAJRBDuv8pWnALRW67HtEDU,801 +peft/tuners/p_tuning/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/p_tuning/__pycache__/config.cpython-310.pyc,, +peft/tuners/p_tuning/__pycache__/model.cpython-310.pyc,, +peft/tuners/p_tuning/config.py,sha256=konpCRWcmzPQgDkvz0gA-xC856poHpyYAWXqES7qBzk,2110 +peft/tuners/p_tuning/model.py,sha256=rv2mbmPOArAefeqhJ09Oz7XNGaScWGRT1hgKlrfhfAw,5575 +peft/tuners/poly/__init__.py,sha256=yCiWTO7o2rWmvAM4CNKyllvIvtE6_QnHuEjbKx7jhgI,759 +peft/tuners/poly/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/poly/__pycache__/config.cpython-310.pyc,, +peft/tuners/poly/__pycache__/layer.cpython-310.pyc,, +peft/tuners/poly/__pycache__/model.cpython-310.pyc,, +peft/tuners/poly/__pycache__/router.cpython-310.pyc,, +peft/tuners/poly/config.py,sha256=FqAjrybzzD4eATX_jG-GBr4QeBDOVE3xTcXKCrQn-dw,3783 +peft/tuners/poly/layer.py,sha256=ArvY2sOnI6xVI-mglFfevOKKKXJPhs9xtFivZkOWWnA,6890 +peft/tuners/poly/model.py,sha256=VtzkgWnjnbAAAf1WMNMUoPUTq6-W58kKIJRWmlinMBk,6782 +peft/tuners/poly/router.py,sha256=qIX6jEI_FSb5Rr5YhIWo8Cr5ZiAmDCiydT7lTuEICp8,2800 +peft/tuners/prefix_tuning/__init__.py,sha256=KCQnKQoFTfx0M2HkQANF36PO6y62oD24gmkdGnpWrXc,723 +peft/tuners/prefix_tuning/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/prefix_tuning/__pycache__/config.cpython-310.pyc,, +peft/tuners/prefix_tuning/__pycache__/model.cpython-310.pyc,, +peft/tuners/prefix_tuning/config.py,sha256=JUCnCtime_7V5iJyX6iBk_8SeYCpJ_Mw-RGYmgzz2Qg,1386 +peft/tuners/prefix_tuning/model.py,sha256=FyE_EBtvvA9bZDX-GRWN6s0MQtcUe57PLD4qRT2ACww,3007 +peft/tuners/prompt_tuning/__init__.py,sha256=HyENdH-fwAAdwsEqFX4Pd4MLfCAZxBiXGqyjxvU4CAE,765 +peft/tuners/prompt_tuning/__pycache__/__init__.cpython-310.pyc,, +peft/tuners/prompt_tuning/__pycache__/config.cpython-310.pyc,, +peft/tuners/prompt_tuning/__pycache__/model.cpython-310.pyc,, +peft/tuners/prompt_tuning/config.py,sha256=RbfmCdnbQ6t0PTwo8NcnVbkQKyHIJaljptRRhRClhJ0,3472 +peft/tuners/prompt_tuning/model.py,sha256=rCCft8hRjVtQIR536hUfhT1ICBuDqWBGSTMPGNdAwTg,3623 +peft/tuners/tuners_utils.py,sha256=iwIWbOXidvE_FlviBi5rZlbjBIRNxIraAwxnw9hXyds,31283 +peft/utils/__init__.py,sha256=HA_S0vk8wMs_85BHxyX3pfdvWhl9F3XxvVzUOTsg42Q,1947 +peft/utils/__pycache__/__init__.cpython-310.pyc,, +peft/utils/__pycache__/constants.cpython-310.pyc,, +peft/utils/__pycache__/integrations.cpython-310.pyc,, +peft/utils/__pycache__/loftq_utils.cpython-310.pyc,, +peft/utils/__pycache__/merge_utils.cpython-310.pyc,, +peft/utils/__pycache__/other.cpython-310.pyc,, +peft/utils/__pycache__/peft_types.cpython-310.pyc,, +peft/utils/__pycache__/save_and_load.cpython-310.pyc,, +peft/utils/constants.py,sha256=6B6JZDmrqqCPtyU8IA8uaXRkibv-IBID6i19CV3A7C4,5751 +peft/utils/integrations.py,sha256=yFJVpki0wJWqHXADdKbMX4Rpa-jkpl0mJ9l5DAVcwTI,2568 +peft/utils/loftq_utils.py,sha256=ouhJhFkrVl31Q0TvMHWLqmiTkFOixq-aSmzappRa4k4,17180 +peft/utils/merge_utils.py,sha256=IAd6DlbPowxAEiuC5OaMwg9hmdO6068DOU18CJ00VIU,9905 +peft/utils/other.py,sha256=gDmVrWGxGCK0KlwBt3JueE7O28uhoPuCbANX0QcbU_8,24273 +peft/utils/peft_types.py,sha256=CIvazG4k07ONOacJKIS8iigYmRj-GxG37v7q57ZzKE0,2147 +peft/utils/save_and_load.py,sha256=5GKT_XQ1xbz9XLUErnmolBWcAgHU_EHaMx6kmoL60fI,14820 diff --git a/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/WHEEL b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..57e3d840d59a650ac5bccbad5baeec47d155f0ad --- /dev/null +++ b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.38.4) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/top_level.txt b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..dc89ba063e639dfa24fd7f53340bc368adbebb7a --- /dev/null +++ b/venv/lib/python3.10/site-packages/peft-0.10.0.dist-info/top_level.txt @@ -0,0 +1 @@ +peft diff --git a/venv/lib/python3.10/site-packages/pydantic_core/__init__.py b/venv/lib/python3.10/site-packages/pydantic_core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5b2655c91c3096e8d560dee093909b283332394a --- /dev/null +++ b/venv/lib/python3.10/site-packages/pydantic_core/__init__.py @@ -0,0 +1,139 @@ +from __future__ import annotations + +import sys as _sys +from typing import Any as _Any + +from ._pydantic_core import ( + ArgsKwargs, + MultiHostUrl, + PydanticCustomError, + PydanticKnownError, + PydanticOmit, + PydanticSerializationError, + PydanticSerializationUnexpectedValue, + PydanticUndefined, + PydanticUndefinedType, + PydanticUseDefault, + SchemaError, + SchemaSerializer, + SchemaValidator, + Some, + TzInfo, + Url, + ValidationError, + __version__, + from_json, + to_json, + to_jsonable_python, + validate_core_schema, +) +from .core_schema import CoreConfig, CoreSchema, CoreSchemaType, ErrorType + +if _sys.version_info < (3, 11): + from typing_extensions import NotRequired as _NotRequired +else: + from typing import NotRequired as _NotRequired + +if _sys.version_info < (3, 9): + from typing_extensions import TypedDict as _TypedDict +else: + from typing import TypedDict as _TypedDict + +__all__ = [ + '__version__', + 'CoreConfig', + 'CoreSchema', + 'CoreSchemaType', + 'SchemaValidator', + 'SchemaSerializer', + 'Some', + 'Url', + 'MultiHostUrl', + 'ArgsKwargs', + 'PydanticUndefined', + 'PydanticUndefinedType', + 'SchemaError', + 'ErrorDetails', + 'InitErrorDetails', + 'ValidationError', + 'PydanticCustomError', + 'PydanticKnownError', + 'PydanticOmit', + 'PydanticUseDefault', + 'PydanticSerializationError', + 'PydanticSerializationUnexpectedValue', + 'TzInfo', + 'to_json', + 'from_json', + 'to_jsonable_python', + 'validate_core_schema', +] + + +class ErrorDetails(_TypedDict): + type: str + """ + The type of error that occurred, this is an identifier designed for + programmatic use that will change rarely or never. + + `type` is unique for each error message, and can hence be used as an identifier to build custom error messages. + """ + loc: tuple[int | str, ...] + """Tuple of strings and ints identifying where in the schema the error occurred.""" + msg: str + """A human readable error message.""" + input: _Any + """The input data at this `loc` that caused the error.""" + ctx: _NotRequired[dict[str, _Any]] + """ + Values which are required to render the error message, and could hence be useful in rendering custom error messages. + Also useful for passing custom error data forward. + """ + + +class InitErrorDetails(_TypedDict): + type: str | PydanticCustomError + """The type of error that occurred, this should a "slug" identifier that changes rarely or never.""" + loc: _NotRequired[tuple[int | str, ...]] + """Tuple of strings and ints identifying where in the schema the error occurred.""" + input: _Any + """The input data at this `loc` that caused the error.""" + ctx: _NotRequired[dict[str, _Any]] + """ + Values which are required to render the error message, and could hence be useful in rendering custom error messages. + Also useful for passing custom error data forward. + """ + + +class ErrorTypeInfo(_TypedDict): + """ + Gives information about errors. + """ + + type: ErrorType + """The type of error that occurred, this should a "slug" identifier that changes rarely or never.""" + message_template_python: str + """String template to render a human readable error message from using context, when the input is Python.""" + example_message_python: str + """Example of a human readable error message, when the input is Python.""" + message_template_json: _NotRequired[str] + """String template to render a human readable error message from using context, when the input is JSON data.""" + example_message_json: _NotRequired[str] + """Example of a human readable error message, when the input is JSON data.""" + example_context: dict[str, _Any] | None + """Example of context values.""" + + +class MultiHostHost(_TypedDict): + """ + A host part of a multi-host URL. + """ + + username: str | None + """The username part of this host, or `None`.""" + password: str | None + """The password part of this host, or `None`.""" + host: str | None + """The host part of this host, or `None`.""" + port: int | None + """The port part of this host, or `None`.""" diff --git a/venv/lib/python3.10/site-packages/pydantic_core/_pydantic_core.pyi b/venv/lib/python3.10/site-packages/pydantic_core/_pydantic_core.pyi new file mode 100644 index 0000000000000000000000000000000000000000..b86b7aad0107bc61c666b0cebaece3b9b7349952 --- /dev/null +++ b/venv/lib/python3.10/site-packages/pydantic_core/_pydantic_core.pyi @@ -0,0 +1,901 @@ +import datetime +from typing import Any, Callable, Generic, Literal, TypeVar, final + +from _typeshed import SupportsAllComparisons +from typing_extensions import LiteralString, Self, TypeAlias + +from pydantic_core import ErrorDetails, ErrorTypeInfo, InitErrorDetails, MultiHostHost +from pydantic_core.core_schema import CoreConfig, CoreSchema, ErrorType + +__all__ = [ + '__version__', + 'build_profile', + 'build_info', + '_recursion_limit', + 'ArgsKwargs', + 'SchemaValidator', + 'SchemaSerializer', + 'Url', + 'MultiHostUrl', + 'SchemaError', + 'ValidationError', + 'PydanticCustomError', + 'PydanticKnownError', + 'PydanticOmit', + 'PydanticUseDefault', + 'PydanticSerializationError', + 'PydanticSerializationUnexpectedValue', + 'PydanticUndefined', + 'PydanticUndefinedType', + 'Some', + 'to_json', + 'from_json', + 'to_jsonable_python', + 'list_all_errors', + 'TzInfo', + 'validate_core_schema', +] +__version__: str +build_profile: str +build_info: str +_recursion_limit: int + +_T = TypeVar('_T', default=Any, covariant=True) + +_StringInput: TypeAlias = 'dict[str, _StringInput]' + +@final +class Some(Generic[_T]): + """ + Similar to Rust's [`Option::Some`](https://doc.rust-lang.org/std/option/enum.Option.html) type, this + identifies a value as being present, and provides a way to access it. + + Generally used in a union with `None` to different between "some value which could be None" and no value. + """ + + __match_args__ = ('value',) + + @property + def value(self) -> _T: + """ + Returns the value wrapped by `Some`. + """ + @classmethod + def __class_getitem__(cls, item: Any, /) -> type[Self]: ... + +@final +class SchemaValidator: + """ + `SchemaValidator` is the Python wrapper for `pydantic-core`'s Rust validation logic, internally it owns one + `CombinedValidator` which may in turn own more `CombinedValidator`s which make up the full schema validator. + """ + + def __new__(cls, schema: CoreSchema, config: CoreConfig | None = None) -> Self: + """ + Create a new SchemaValidator. + + Arguments: + schema: The [`CoreSchema`][pydantic_core.core_schema.CoreSchema] to use for validation. + config: Optionally a [`CoreConfig`][pydantic_core.core_schema.CoreConfig] to configure validation. + """ + @property + def title(self) -> str: + """ + The title of the schema, as used in the heading of [`ValidationError.__str__()`][pydantic_core.ValidationError]. + """ + def validate_python( + self, + input: Any, + *, + strict: bool | None = None, + from_attributes: bool | None = None, + context: dict[str, Any] | None = None, + self_instance: Any | None = None, + ) -> Any: + """ + Validate a Python object against the schema and return the validated object. + + Arguments: + input: The Python object to validate. + strict: Whether to validate the object in strict mode. + If `None`, the value of [`CoreConfig.strict`][pydantic_core.core_schema.CoreConfig] is used. + from_attributes: Whether to validate objects as inputs to models by extracting attributes. + If `None`, the value of [`CoreConfig.from_attributes`][pydantic_core.core_schema.CoreConfig] is used. + context: The context to use for validation, this is passed to functional validators as + [`info.context`][pydantic_core.core_schema.ValidationInfo.context]. + self_instance: An instance of a model set attributes on from validation, this is used when running + validation from the `__init__` method of a model. + + Raises: + ValidationError: If validation fails. + Exception: Other error types maybe raised if internal errors occur. + + Returns: + The validated object. + """ + def isinstance_python( + self, + input: Any, + *, + strict: bool | None = None, + from_attributes: bool | None = None, + context: dict[str, Any] | None = None, + self_instance: Any | None = None, + ) -> bool: + """ + Similar to [`validate_python()`][pydantic_core.SchemaValidator.validate_python] but returns a boolean. + + Arguments match `validate_python()`. This method will not raise `ValidationError`s but will raise internal + errors. + + Returns: + `True` if validation succeeds, `False` if validation fails. + """ + def validate_json( + self, + input: str | bytes | bytearray, + *, + strict: bool | None = None, + context: dict[str, Any] | None = None, + self_instance: Any | None = None, + ) -> Any: + """ + Validate JSON data directly against the schema and return the validated Python object. + + This method should be significantly faster than `validate_python(json.loads(json_data))` as it avoids the + need to create intermediate Python objects + + It also handles constructing the correct Python type even in strict mode, where + `validate_python(json.loads(json_data))` would fail validation. + + Arguments: + input: The JSON data to validate. + strict: Whether to validate the object in strict mode. + If `None`, the value of [`CoreConfig.strict`][pydantic_core.core_schema.CoreConfig] is used. + context: The context to use for validation, this is passed to functional validators as + [`info.context`][pydantic_core.core_schema.ValidationInfo.context]. + self_instance: An instance of a model set attributes on from validation. + + Raises: + ValidationError: If validation fails or if the JSON data is invalid. + Exception: Other error types maybe raised if internal errors occur. + + Returns: + The validated Python object. + """ + def validate_strings( + self, input: _StringInput, *, strict: bool | None = None, context: dict[str, Any] | None = None + ) -> Any: + """ + Validate a string against the schema and return the validated Python object. + + This is similar to `validate_json` but applies to scenarios where the input will be a string but not + JSON data, e.g. URL fragments, query parameters, etc. + + Arguments: + input: The input as a string, or bytes/bytearray if `strict=False`. + strict: Whether to validate the object in strict mode. + If `None`, the value of [`CoreConfig.strict`][pydantic_core.core_schema.CoreConfig] is used. + context: The context to use for validation, this is passed to functional validators as + [`info.context`][pydantic_core.core_schema.ValidationInfo.context]. + + Raises: + ValidationError: If validation fails or if the JSON data is invalid. + Exception: Other error types maybe raised if internal errors occur. + + Returns: + The validated Python object. + """ + def validate_assignment( + self, + obj: Any, + field_name: str, + field_value: Any, + *, + strict: bool | None = None, + from_attributes: bool | None = None, + context: dict[str, Any] | None = None, + ) -> dict[str, Any] | tuple[dict[str, Any], dict[str, Any] | None, set[str]]: + """ + Validate an assignment to a field on a model. + + Arguments: + obj: The model instance being assigned to. + field_name: The name of the field to validate assignment for. + field_value: The value to assign to the field. + strict: Whether to validate the object in strict mode. + If `None`, the value of [`CoreConfig.strict`][pydantic_core.core_schema.CoreConfig] is used. + from_attributes: Whether to validate objects as inputs to models by extracting attributes. + If `None`, the value of [`CoreConfig.from_attributes`][pydantic_core.core_schema.CoreConfig] is used. + context: The context to use for validation, this is passed to functional validators as + [`info.context`][pydantic_core.core_schema.ValidationInfo.context]. + + Raises: + ValidationError: If validation fails. + Exception: Other error types maybe raised if internal errors occur. + + Returns: + Either the model dict or a tuple of `(model_data, model_extra, fields_set)` + """ + def get_default_value(self, *, strict: bool | None = None, context: Any = None) -> Some | None: + """ + Get the default value for the schema, including running default value validation. + + Arguments: + strict: Whether to validate the default value in strict mode. + If `None`, the value of [`CoreConfig.strict`][pydantic_core.core_schema.CoreConfig] is used. + context: The context to use for validation, this is passed to functional validators as + [`info.context`][pydantic_core.core_schema.ValidationInfo.context]. + + Raises: + ValidationError: If validation fails. + Exception: Other error types maybe raised if internal errors occur. + + Returns: + `None` if the schema has no default value, otherwise a [`Some`][pydantic_core.Some] containing the default. + """ + +_IncEx: TypeAlias = set[int] | set[str] | dict[int, _IncEx] | dict[str, _IncEx] | None + +@final +class SchemaSerializer: + """ + `SchemaSerializer` is the Python wrapper for `pydantic-core`'s Rust serialization logic, internally it owns one + `CombinedSerializer` which may in turn own more `CombinedSerializer`s which make up the full schema serializer. + """ + + def __new__(cls, schema: CoreSchema, config: CoreConfig | None = None) -> Self: + """ + Create a new SchemaSerializer. + + Arguments: + schema: The [`CoreSchema`][pydantic_core.core_schema.CoreSchema] to use for serialization. + config: Optionally a [`CoreConfig`][pydantic_core.core_schema.CoreConfig] to to configure serialization. + """ + def to_python( + self, + value: Any, + *, + mode: str | None = None, + include: _IncEx = None, + exclude: _IncEx = None, + by_alias: bool = True, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, + round_trip: bool = False, + warnings: bool | Literal['none', 'warn', 'error'] = True, + fallback: Callable[[Any], Any] | None = None, + serialize_as_any: bool = False, + context: dict[str, Any] | None = None, + ) -> Any: + """ + Serialize/marshal a Python object to a Python object including transforming and filtering data. + + Arguments: + value: The Python object to serialize. + mode: The serialization mode to use, either `'python'` or `'json'`, defaults to `'python'`. In JSON mode, + all values are converted to JSON compatible types, e.g. `None`, `int`, `float`, `str`, `list`, `dict`. + include: A set of fields to include, if `None` all fields are included. + exclude: A set of fields to exclude, if `None` no fields are excluded. + by_alias: Whether to use the alias names of fields. + exclude_unset: Whether to exclude fields that are not set, + e.g. are not included in `__pydantic_fields_set__`. + exclude_defaults: Whether to exclude fields that are equal to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: Whether to enable serialization and validation round-trip support. + warnings: How to handle invalid fields. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered, + if `None` a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + context: The context to use for serialization, this is passed to functional serializers as + [`info.context`][pydantic_core.core_schema.SerializationInfo.context]. + + Raises: + PydanticSerializationError: If serialization fails and no `fallback` function is provided. + + Returns: + The serialized Python object. + """ + def to_json( + self, + value: Any, + *, + indent: int | None = None, + include: _IncEx = None, + exclude: _IncEx = None, + by_alias: bool = True, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, + round_trip: bool = False, + warnings: bool | Literal['none', 'warn', 'error'] = True, + fallback: Callable[[Any], Any] | None = None, + serialize_as_any: bool = False, + context: dict[str, Any] | None = None, + ) -> bytes: + """ + Serialize a Python object to JSON including transforming and filtering data. + + Arguments: + value: The Python object to serialize. + indent: If `None`, the JSON will be compact, otherwise it will be pretty-printed with the indent provided. + include: A set of fields to include, if `None` all fields are included. + exclude: A set of fields to exclude, if `None` no fields are excluded. + by_alias: Whether to use the alias names of fields. + exclude_unset: Whether to exclude fields that are not set, + e.g. are not included in `__pydantic_fields_set__`. + exclude_defaults: Whether to exclude fields that are equal to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: Whether to enable serialization and validation round-trip support. + warnings: How to handle invalid fields. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered, + if `None` a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + context: The context to use for serialization, this is passed to functional serializers as + [`info.context`][pydantic_core.core_schema.SerializationInfo.context]. + + Raises: + PydanticSerializationError: If serialization fails and no `fallback` function is provided. + + Returns: + JSON bytes. + """ + +def to_json( + value: Any, + *, + indent: int | None = None, + include: _IncEx = None, + exclude: _IncEx = None, + by_alias: bool = True, + exclude_none: bool = False, + round_trip: bool = False, + timedelta_mode: Literal['iso8601', 'float'] = 'iso8601', + bytes_mode: Literal['utf8', 'base64'] = 'utf8', + inf_nan_mode: Literal['null', 'constants'] = 'constants', + serialize_unknown: bool = False, + fallback: Callable[[Any], Any] | None = None, + serialize_as_any: bool = False, + context: dict[str, Any] | None = None, +) -> bytes: + """ + Serialize a Python object to JSON including transforming and filtering data. + + This is effectively a standalone version of [`SchemaSerializer.to_json`][pydantic_core.SchemaSerializer.to_json]. + + Arguments: + value: The Python object to serialize. + indent: If `None`, the JSON will be compact, otherwise it will be pretty-printed with the indent provided. + include: A set of fields to include, if `None` all fields are included. + exclude: A set of fields to exclude, if `None` no fields are excluded. + by_alias: Whether to use the alias names of fields. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: Whether to enable serialization and validation round-trip support. + timedelta_mode: How to serialize `timedelta` objects, either `'iso8601'` or `'float'`. + bytes_mode: How to serialize `bytes` objects, either `'utf8'` or `'base64'`. + inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'` or `'constants'`. + serialize_unknown: Attempt to serialize unknown types, `str(value)` will be used, if that fails + `""` will be used. + fallback: A function to call when an unknown value is encountered, + if `None` a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + context: The context to use for serialization, this is passed to functional serializers as + [`info.context`][pydantic_core.core_schema.SerializationInfo.context]. + + Raises: + PydanticSerializationError: If serialization fails and no `fallback` function is provided. + + Returns: + JSON bytes. + """ + +def from_json( + data: str | bytes | bytearray, + *, + allow_inf_nan: bool = True, + cache_strings: bool | Literal['all', 'keys', 'none'] = True, + allow_partial: bool = False, +) -> Any: + """ + Deserialize JSON data to a Python object. + + This is effectively a faster version of `json.loads()`, with some extra functionality. + + Arguments: + data: The JSON data to deserialize. + allow_inf_nan: Whether to allow `Infinity`, `-Infinity` and `NaN` values as `json.loads()` does by default. + cache_strings: Whether to cache strings to avoid constructing new Python objects, + this should have a significant impact on performance while increasing memory usage slightly, + `all/True` means cache all strings, `keys` means cache only dict keys, `none/False` means no caching. + allow_partial: Whether to allow partial deserialization, if `True` JSON data is returned if the end of the + input is reached before the full object is deserialized, e.g. `["aa", "bb", "c` would return `['aa', 'bb']`. + + Raises: + ValueError: If deserialization fails. + + Returns: + The deserialized Python object. + """ + +def to_jsonable_python( + value: Any, + *, + include: _IncEx = None, + exclude: _IncEx = None, + by_alias: bool = True, + exclude_none: bool = False, + round_trip: bool = False, + timedelta_mode: Literal['iso8601', 'float'] = 'iso8601', + bytes_mode: Literal['utf8', 'base64'] = 'utf8', + inf_nan_mode: Literal['null', 'constants'] = 'constants', + serialize_unknown: bool = False, + fallback: Callable[[Any], Any] | None = None, + serialize_as_any: bool = False, + context: dict[str, Any] | None = None, +) -> Any: + """ + Serialize/marshal a Python object to a JSON-serializable Python object including transforming and filtering data. + + This is effectively a standalone version of + [`SchemaSerializer.to_python(mode='json')`][pydantic_core.SchemaSerializer.to_python]. + + Args: + value: The Python object to serialize. + include: A set of fields to include, if `None` all fields are included. + exclude: A set of fields to exclude, if `None` no fields are excluded. + by_alias: Whether to use the alias names of fields. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: Whether to enable serialization and validation round-trip support. + timedelta_mode: How to serialize `timedelta` objects, either `'iso8601'` or `'float'`. + bytes_mode: How to serialize `bytes` objects, either `'utf8'` or `'base64'`. + inf_nan_mode: How to serialize `Infinity`, `-Infinity` and `NaN` values, either `'null'` or `'constants'`. + serialize_unknown: Attempt to serialize unknown types, `str(value)` will be used, if that fails + `""` will be used. + fallback: A function to call when an unknown value is encountered, + if `None` a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. + context: The context to use for serialization, this is passed to functional serializers as + [`info.context`][pydantic_core.core_schema.SerializationInfo.context]. + + Raises: + PydanticSerializationError: If serialization fails and no `fallback` function is provided. + + Returns: + The serialized Python object. + """ + +class Url(SupportsAllComparisons): + """ + A URL type, internal logic uses the [url rust crate](https://docs.rs/url/latest/url/) originally developed + by Mozilla. + """ + + def __new__(cls, url: str) -> Self: + """ + Create a new `Url` instance. + + Args: + url: String representation of a URL. + + Returns: + A new `Url` instance. + + Raises: + ValidationError: If the URL is invalid. + """ + @property + def scheme(self) -> str: + """ + The scheme part of the URL. + + e.g. `https` in `https://user:pass@host:port/path?query#fragment` + """ + @property + def username(self) -> str | None: + """ + The username part of the URL, or `None`. + + e.g. `user` in `https://user:pass@host:port/path?query#fragment` + """ + @property + def password(self) -> str | None: + """ + The password part of the URL, or `None`. + + e.g. `pass` in `https://user:pass@host:port/path?query#fragment` + """ + @property + def host(self) -> str | None: + """ + The host part of the URL, or `None`. + + If the URL must be punycode encoded, this is the encoded host, e.g if the input URL is `https://£££.com`, + `host` will be `xn--9aaa.com` + """ + def unicode_host(self) -> str | None: + """ + The host part of the URL as a unicode string, or `None`. + + e.g. `host` in `https://user:pass@host:port/path?query#fragment` + + If the URL must be punycode encoded, this is the decoded host, e.g if the input URL is `https://£££.com`, + `unicode_host()` will be `£££.com` + """ + @property + def port(self) -> int | None: + """ + The port part of the URL, or `None`. + + e.g. `port` in `https://user:pass@host:port/path?query#fragment` + """ + @property + def path(self) -> str | None: + """ + The path part of the URL, or `None`. + + e.g. `/path` in `https://user:pass@host:port/path?query#fragment` + """ + @property + def query(self) -> str | None: + """ + The query part of the URL, or `None`. + + e.g. `query` in `https://user:pass@host:port/path?query#fragment` + """ + def query_params(self) -> list[tuple[str, str]]: + """ + The query part of the URL as a list of key-value pairs. + + e.g. `[('foo', 'bar')]` in `https://user:pass@host:port/path?foo=bar#fragment` + """ + @property + def fragment(self) -> str | None: + """ + The fragment part of the URL, or `None`. + + e.g. `fragment` in `https://user:pass@host:port/path?query#fragment` + """ + def unicode_string(self) -> str: + """ + The URL as a unicode string, unlike `__str__()` this will not punycode encode the host. + + If the URL must be punycode encoded, this is the decoded string, e.g if the input URL is `https://£££.com`, + `unicode_string()` will be `https://£££.com` + """ + def __repr__(self) -> str: ... + def __str__(self) -> str: + """ + The URL as a string, this will punycode encode the host if required. + """ + def __deepcopy__(self, memo: dict) -> str: ... + @classmethod + def build( + cls, + *, + scheme: str, + username: str | None = None, + password: str | None = None, + host: str, + port: int | None = None, + path: str | None = None, + query: str | None = None, + fragment: str | None = None, + ) -> Self: + """ + Build a new `Url` instance from its component parts. + + Args: + scheme: The scheme part of the URL. + username: The username part of the URL, or omit for no username. + password: The password part of the URL, or omit for no password. + host: The host part of the URL. + port: The port part of the URL, or omit for no port. + path: The path part of the URL, or omit for no path. + query: The query part of the URL, or omit for no query. + fragment: The fragment part of the URL, or omit for no fragment. + + Returns: + An instance of URL + """ + +class MultiHostUrl(SupportsAllComparisons): + """ + A URL type with support for multiple hosts, as used by some databases for DSNs, e.g. `https://foo.com,bar.com/path`. + + Internal URL logic uses the [url rust crate](https://docs.rs/url/latest/url/) originally developed + by Mozilla. + """ + + def __new__(cls, url: str) -> Self: + """ + Create a new `MultiHostUrl` instance. + + Args: + url: String representation of a URL. + + Returns: + A new `MultiHostUrl` instance. + + Raises: + ValidationError: If the URL is invalid. + """ + @property + def scheme(self) -> str: + """ + The scheme part of the URL. + + e.g. `https` in `https://foo.com,bar.com/path?query#fragment` + """ + @property + def path(self) -> str | None: + """ + The path part of the URL, or `None`. + + e.g. `/path` in `https://foo.com,bar.com/path?query#fragment` + """ + @property + def query(self) -> str | None: + """ + The query part of the URL, or `None`. + + e.g. `query` in `https://foo.com,bar.com/path?query#fragment` + """ + def query_params(self) -> list[tuple[str, str]]: + """ + The query part of the URL as a list of key-value pairs. + + e.g. `[('foo', 'bar')]` in `https://foo.com,bar.com/path?query#fragment` + """ + @property + def fragment(self) -> str | None: + """ + The fragment part of the URL, or `None`. + + e.g. `fragment` in `https://foo.com,bar.com/path?query#fragment` + """ + def hosts(self) -> list[MultiHostHost]: + ''' + + The hosts of the `MultiHostUrl` as [`MultiHostHost`][pydantic_core.MultiHostHost] typed dicts. + + ```py + from pydantic_core import MultiHostUrl + + mhu = MultiHostUrl('https://foo.com:123,foo:bar@bar.com/path') + print(mhu.hosts()) + """ + [ + {'username': None, 'password': None, 'host': 'foo.com', 'port': 123}, + {'username': 'foo', 'password': 'bar', 'host': 'bar.com', 'port': 443} + ] + ``` + Returns: + A list of dicts, each representing a host. + ''' + def unicode_string(self) -> str: + """ + The URL as a unicode string, unlike `__str__()` this will not punycode encode the hosts. + """ + def __repr__(self) -> str: ... + def __str__(self) -> str: + """ + The URL as a string, this will punycode encode the hosts if required. + """ + def __deepcopy__(self, memo: dict) -> Self: ... + @classmethod + def build( + cls, + *, + scheme: str, + hosts: list[MultiHostHost] | None = None, + username: str | None = None, + password: str | None = None, + host: str | None = None, + port: int | None = None, + path: str | None = None, + query: str | None = None, + fragment: str | None = None, + ) -> Self: + """ + Build a new `MultiHostUrl` instance from its component parts. + + This method takes either `hosts` - a list of `MultiHostHost` typed dicts, or the individual components + `username`, `password`, `host` and `port`. + + Args: + scheme: The scheme part of the URL. + hosts: Multiple hosts to build the URL from. + username: The username part of the URL. + password: The password part of the URL. + host: The host part of the URL. + port: The port part of the URL. + path: The path part of the URL. + query: The query part of the URL, or omit for no query. + fragment: The fragment part of the URL, or omit for no fragment. + + Returns: + An instance of `MultiHostUrl` + """ + +@final +class SchemaError(Exception): + """ + Information about errors that occur while building a [`SchemaValidator`][pydantic_core.SchemaValidator] + or [`SchemaSerializer`][pydantic_core.SchemaSerializer]. + """ + + def error_count(self) -> int: + """ + Returns: + The number of errors in the schema. + """ + def errors(self) -> list[ErrorDetails]: + """ + Returns: + A list of [`ErrorDetails`][pydantic_core.ErrorDetails] for each error in the schema. + """ + +@final +class ValidationError(ValueError): + """ + `ValidationError` is the exception raised by `pydantic-core` when validation fails, it contains a list of errors + which detail why validation failed. + """ + + @staticmethod + def from_exception_data( + title: str, + line_errors: list[InitErrorDetails], + input_type: Literal['python', 'json'] = 'python', + hide_input: bool = False, + ) -> ValidationError: + """ + Python constructor for a Validation Error. + + The API for constructing validation errors will probably change in the future, + hence the static method rather than `__init__`. + + Arguments: + title: The title of the error, as used in the heading of `str(validation_error)` + line_errors: A list of [`InitErrorDetails`][pydantic_core.InitErrorDetails] which contain information + about errors that occurred during validation. + input_type: Whether the error is for a Python object or JSON. + hide_input: Whether to hide the input value in the error message. + """ + @property + def title(self) -> str: + """ + The title of the error, as used in the heading of `str(validation_error)`. + """ + def error_count(self) -> int: + """ + Returns: + The number of errors in the validation error. + """ + def errors( + self, *, include_url: bool = True, include_context: bool = True, include_input: bool = True + ) -> list[ErrorDetails]: + """ + Details about each error in the validation error. + + Args: + include_url: Whether to include a URL to documentation on the error each error. + include_context: Whether to include the context of each error. + include_input: Whether to include the input value of each error. + + Returns: + A list of [`ErrorDetails`][pydantic_core.ErrorDetails] for each error in the validation error. + """ + def json( + self, + *, + indent: int | None = None, + include_url: bool = True, + include_context: bool = True, + include_input: bool = True, + ) -> str: + """ + Same as [`errors()`][pydantic_core.ValidationError.errors] but returns a JSON string. + + Args: + indent: The number of spaces to indent the JSON by, or `None` for no indentation - compact JSON. + include_url: Whether to include a URL to documentation on the error each error. + include_context: Whether to include the context of each error. + include_input: Whether to include the input value of each error. + + Returns: + a JSON string. + """ + + def __repr__(self) -> str: + """ + A string representation of the validation error. + + Whether or not documentation URLs are included in the repr is controlled by the + environment variable `PYDANTIC_ERRORS_INCLUDE_URL` being set to `1` or + `true`; by default, URLs are shown. + + Due to implementation details, this environment variable can only be set once, + before the first validation error is created. + """ + +@final +class PydanticCustomError(ValueError): + def __new__( + cls, error_type: LiteralString, message_template: LiteralString, context: dict[str, Any] | None = None + ) -> Self: ... + @property + def context(self) -> dict[str, Any] | None: ... + @property + def type(self) -> str: ... + @property + def message_template(self) -> str: ... + def message(self) -> str: ... + +@final +class PydanticKnownError(ValueError): + def __new__(cls, error_type: ErrorType, context: dict[str, Any] | None = None) -> Self: ... + @property + def context(self) -> dict[str, Any] | None: ... + @property + def type(self) -> ErrorType: ... + @property + def message_template(self) -> str: ... + def message(self) -> str: ... + +@final +class PydanticOmit(Exception): + def __new__(cls) -> Self: ... + +@final +class PydanticUseDefault(Exception): + def __new__(cls) -> Self: ... + +@final +class PydanticSerializationError(ValueError): + def __new__(cls, message: str) -> Self: ... + +@final +class PydanticSerializationUnexpectedValue(ValueError): + def __new__(cls, message: str | None = None) -> Self: ... + +@final +class ArgsKwargs: + def __new__(cls, args: tuple[Any, ...], kwargs: dict[str, Any] | None = None) -> Self: ... + @property + def args(self) -> tuple[Any, ...]: ... + @property + def kwargs(self) -> dict[str, Any] | None: ... + +@final +class PydanticUndefinedType: + def __copy__(self) -> Self: ... + def __deepcopy__(self, memo: Any) -> Self: ... + +PydanticUndefined: PydanticUndefinedType + +def list_all_errors() -> list[ErrorTypeInfo]: + """ + Get information about all built-in errors. + + Returns: + A list of `ErrorTypeInfo` typed dicts. + """ +@final +class TzInfo(datetime.tzinfo): + def tzname(self, _dt: datetime.datetime | None) -> str | None: ... + def utcoffset(self, _dt: datetime.datetime | None) -> datetime.timedelta: ... + def dst(self, _dt: datetime.datetime | None) -> datetime.timedelta: ... + def fromutc(self, dt: datetime.datetime) -> datetime.datetime: ... + def __deepcopy__(self, _memo: dict[Any, Any]) -> TzInfo: ... + +def validate_core_schema(schema: CoreSchema, *, strict: bool | None = None) -> CoreSchema: + """Validate a CoreSchema + This currently uses lax mode for validation (i.e. will coerce strings to dates and such) + but may use strict mode in the future. + We may also remove this function altogether, do not rely on it being present if you are + using pydantic-core directly. + """ diff --git a/venv/lib/python3.10/site-packages/pydantic_core/core_schema.py b/venv/lib/python3.10/site-packages/pydantic_core/core_schema.py new file mode 100644 index 0000000000000000000000000000000000000000..2cb875b23eee31a7700d754e656561e6bd868473 --- /dev/null +++ b/venv/lib/python3.10/site-packages/pydantic_core/core_schema.py @@ -0,0 +1,4045 @@ +""" +This module contains definitions to build schemas which `pydantic_core` can +validate and serialize. +""" + +from __future__ import annotations as _annotations + +import sys +import warnings +from collections.abc import Mapping +from datetime import date, datetime, time, timedelta +from decimal import Decimal +from typing import TYPE_CHECKING, Any, Callable, Dict, Hashable, List, Set, Tuple, Type, Union + +from typing_extensions import deprecated + +if sys.version_info < (3, 12): + from typing_extensions import TypedDict +else: + from typing import TypedDict + +if sys.version_info < (3, 11): + from typing_extensions import Protocol, Required, TypeAlias +else: + from typing import Protocol, Required, TypeAlias + +if sys.version_info < (3, 9): + from typing_extensions import Literal +else: + from typing import Literal + +if TYPE_CHECKING: + from pydantic_core import PydanticUndefined +else: + # The initial build of pydantic_core requires PydanticUndefined to generate + # the core schema; so we need to conditionally skip it. mypy doesn't like + # this at all, hence the TYPE_CHECKING branch above. + try: + from pydantic_core import PydanticUndefined + except ImportError: + PydanticUndefined = object() + + +ExtraBehavior = Literal['allow', 'forbid', 'ignore'] + + +class CoreConfig(TypedDict, total=False): + """ + Base class for schema configuration options. + + Attributes: + title: The name of the configuration. + strict: Whether the configuration should strictly adhere to specified rules. + extra_fields_behavior: The behavior for handling extra fields. + typed_dict_total: Whether the TypedDict should be considered total. Default is `True`. + from_attributes: Whether to use attributes for models, dataclasses, and tagged union keys. + loc_by_alias: Whether to use the used alias (or first alias for "field required" errors) instead of + `field_names` to construct error `loc`s. Default is `True`. + revalidate_instances: Whether instances of models and dataclasses should re-validate. Default is 'never'. + validate_default: Whether to validate default values during validation. Default is `False`. + populate_by_name: Whether an aliased field may be populated by its name as given by the model attribute, + as well as the alias. (Replaces 'allow_population_by_field_name' in Pydantic v1.) Default is `False`. + str_max_length: The maximum length for string fields. + str_min_length: The minimum length for string fields. + str_strip_whitespace: Whether to strip whitespace from string fields. + str_to_lower: Whether to convert string fields to lowercase. + str_to_upper: Whether to convert string fields to uppercase. + allow_inf_nan: Whether to allow infinity and NaN values for float fields. Default is `True`. + ser_json_timedelta: The serialization option for `timedelta` values. Default is 'iso8601'. + ser_json_bytes: The serialization option for `bytes` values. Default is 'utf8'. + ser_json_inf_nan: The serialization option for infinity and NaN values + in float fields. Default is 'null'. + hide_input_in_errors: Whether to hide input data from `ValidationError` representation. + validation_error_cause: Whether to add user-python excs to the __cause__ of a ValidationError. + Requires exceptiongroup backport pre Python 3.11. + coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode). + regex_engine: The regex engine to use for regex pattern validation. Default is 'rust-regex'. See `StringSchema`. + cache_strings: Whether to cache strings. Default is `True`, `True` or `'all'` is required to cache strings + during general validation since validators don't know if they're in a key or a value. + """ + + title: str + strict: bool + # settings related to typed dicts, model fields, dataclass fields + extra_fields_behavior: ExtraBehavior + typed_dict_total: bool # default: True + # used for models, dataclasses, and tagged union keys + from_attributes: bool + # whether to use the used alias (or first alias for "field required" errors) instead of field_names + # to construct error `loc`s, default True + loc_by_alias: bool + # whether instances of models and dataclasses (including subclass instances) should re-validate, default 'never' + revalidate_instances: Literal['always', 'never', 'subclass-instances'] + # whether to validate default values during validation, default False + validate_default: bool + # used on typed-dicts and arguments + populate_by_name: bool # replaces `allow_population_by_field_name` in pydantic v1 + # fields related to string fields only + str_max_length: int + str_min_length: int + str_strip_whitespace: bool + str_to_lower: bool + str_to_upper: bool + # fields related to float fields only + allow_inf_nan: bool # default: True + # the config options are used to customise serialization to JSON + ser_json_timedelta: Literal['iso8601', 'float'] # default: 'iso8601' + ser_json_bytes: Literal['utf8', 'base64', 'hex'] # default: 'utf8' + ser_json_inf_nan: Literal['null', 'constants'] # default: 'null' + # used to hide input data from ValidationError repr + hide_input_in_errors: bool + validation_error_cause: bool # default: False + coerce_numbers_to_str: bool # default: False + regex_engine: Literal['rust-regex', 'python-re'] # default: 'rust-regex' + cache_strings: Union[bool, Literal['all', 'keys', 'none']] # default: 'True' + + +IncExCall: TypeAlias = 'set[int | str] | dict[int | str, IncExCall] | None' + + +class SerializationInfo(Protocol): + @property + def include(self) -> IncExCall: ... + + @property + def exclude(self) -> IncExCall: ... + + @property + def context(self) -> Any | None: + """Current serialization context.""" + + @property + def mode(self) -> str: ... + + @property + def by_alias(self) -> bool: ... + + @property + def exclude_unset(self) -> bool: ... + + @property + def exclude_defaults(self) -> bool: ... + + @property + def exclude_none(self) -> bool: ... + + @property + def serialize_as_any(self) -> bool: ... + + def round_trip(self) -> bool: ... + + def mode_is_json(self) -> bool: ... + + def __str__(self) -> str: ... + + def __repr__(self) -> str: ... + + +class FieldSerializationInfo(SerializationInfo, Protocol): + @property + def field_name(self) -> str: ... + + +class ValidationInfo(Protocol): + """ + Argument passed to validation functions. + """ + + @property + def context(self) -> Any | None: + """Current validation context.""" + ... + + @property + def config(self) -> CoreConfig | None: + """The CoreConfig that applies to this validation.""" + ... + + @property + def mode(self) -> Literal['python', 'json']: + """The type of input data we are currently validating""" + ... + + @property + def data(self) -> Dict[str, Any]: + """The data being validated for this model.""" + ... + + @property + def field_name(self) -> str | None: + """ + The name of the current field being validated if this validator is + attached to a model field. + """ + ... + + +ExpectedSerializationTypes = Literal[ + 'none', + 'int', + 'bool', + 'float', + 'str', + 'bytes', + 'bytearray', + 'list', + 'tuple', + 'set', + 'frozenset', + 'generator', + 'dict', + 'datetime', + 'date', + 'time', + 'timedelta', + 'url', + 'multi-host-url', + 'json', + 'uuid', +] + + +class SimpleSerSchema(TypedDict, total=False): + type: Required[ExpectedSerializationTypes] + + +def simple_ser_schema(type: ExpectedSerializationTypes) -> SimpleSerSchema: + """ + Returns a schema for serialization with a custom type. + + Args: + type: The type to use for serialization + """ + return SimpleSerSchema(type=type) + + +# (input_value: Any, /) -> Any +GeneralPlainNoInfoSerializerFunction = Callable[[Any], Any] +# (input_value: Any, info: FieldSerializationInfo, /) -> Any +GeneralPlainInfoSerializerFunction = Callable[[Any, SerializationInfo], Any] +# (model: Any, input_value: Any, /) -> Any +FieldPlainNoInfoSerializerFunction = Callable[[Any, Any], Any] +# (model: Any, input_value: Any, info: FieldSerializationInfo, /) -> Any +FieldPlainInfoSerializerFunction = Callable[[Any, Any, FieldSerializationInfo], Any] +SerializerFunction = Union[ + GeneralPlainNoInfoSerializerFunction, + GeneralPlainInfoSerializerFunction, + FieldPlainNoInfoSerializerFunction, + FieldPlainInfoSerializerFunction, +] + +WhenUsed = Literal['always', 'unless-none', 'json', 'json-unless-none'] +""" +Values have the following meanings: + +* `'always'` means always use +* `'unless-none'` means use unless the value is `None` +* `'json'` means use when serializing to JSON +* `'json-unless-none'` means use when serializing to JSON and the value is not `None` +""" + + +class PlainSerializerFunctionSerSchema(TypedDict, total=False): + type: Required[Literal['function-plain']] + function: Required[SerializerFunction] + is_field_serializer: bool # default False + info_arg: bool # default False + return_schema: CoreSchema # if omitted, AnySchema is used + when_used: WhenUsed # default: 'always' + + +def plain_serializer_function_ser_schema( + function: SerializerFunction, + *, + is_field_serializer: bool | None = None, + info_arg: bool | None = None, + return_schema: CoreSchema | None = None, + when_used: WhenUsed = 'always', +) -> PlainSerializerFunctionSerSchema: + """ + Returns a schema for serialization with a function, can be either a "general" or "field" function. + + Args: + function: The function to use for serialization + is_field_serializer: Whether the serializer is for a field, e.g. takes `model` as the first argument, + and `info` includes `field_name` + info_arg: Whether the function takes an `info` argument + return_schema: Schema to use for serializing return value + when_used: When the function should be called + """ + if when_used == 'always': + # just to avoid extra elements in schema, and to use the actual default defined in rust + when_used = None # type: ignore + return _dict_not_none( + type='function-plain', + function=function, + is_field_serializer=is_field_serializer, + info_arg=info_arg, + return_schema=return_schema, + when_used=when_used, + ) + + +class SerializerFunctionWrapHandler(Protocol): # pragma: no cover + def __call__(self, input_value: Any, index_key: int | str | None = None, /) -> Any: ... + + +# (input_value: Any, serializer: SerializerFunctionWrapHandler, /) -> Any +GeneralWrapNoInfoSerializerFunction = Callable[[Any, SerializerFunctionWrapHandler], Any] +# (input_value: Any, serializer: SerializerFunctionWrapHandler, info: SerializationInfo, /) -> Any +GeneralWrapInfoSerializerFunction = Callable[[Any, SerializerFunctionWrapHandler, SerializationInfo], Any] +# (model: Any, input_value: Any, serializer: SerializerFunctionWrapHandler, /) -> Any +FieldWrapNoInfoSerializerFunction = Callable[[Any, Any, SerializerFunctionWrapHandler], Any] +# (model: Any, input_value: Any, serializer: SerializerFunctionWrapHandler, info: FieldSerializationInfo, /) -> Any +FieldWrapInfoSerializerFunction = Callable[[Any, Any, SerializerFunctionWrapHandler, FieldSerializationInfo], Any] +WrapSerializerFunction = Union[ + GeneralWrapNoInfoSerializerFunction, + GeneralWrapInfoSerializerFunction, + FieldWrapNoInfoSerializerFunction, + FieldWrapInfoSerializerFunction, +] + + +class WrapSerializerFunctionSerSchema(TypedDict, total=False): + type: Required[Literal['function-wrap']] + function: Required[WrapSerializerFunction] + is_field_serializer: bool # default False + info_arg: bool # default False + schema: CoreSchema # if omitted, the schema on which this serializer is defined is used + return_schema: CoreSchema # if omitted, AnySchema is used + when_used: WhenUsed # default: 'always' + + +def wrap_serializer_function_ser_schema( + function: WrapSerializerFunction, + *, + is_field_serializer: bool | None = None, + info_arg: bool | None = None, + schema: CoreSchema | None = None, + return_schema: CoreSchema | None = None, + when_used: WhenUsed = 'always', +) -> WrapSerializerFunctionSerSchema: + """ + Returns a schema for serialization with a wrap function, can be either a "general" or "field" function. + + Args: + function: The function to use for serialization + is_field_serializer: Whether the serializer is for a field, e.g. takes `model` as the first argument, + and `info` includes `field_name` + info_arg: Whether the function takes an `info` argument + schema: The schema to use for the inner serialization + return_schema: Schema to use for serializing return value + when_used: When the function should be called + """ + if when_used == 'always': + # just to avoid extra elements in schema, and to use the actual default defined in rust + when_used = None # type: ignore + return _dict_not_none( + type='function-wrap', + function=function, + is_field_serializer=is_field_serializer, + info_arg=info_arg, + schema=schema, + return_schema=return_schema, + when_used=when_used, + ) + + +class FormatSerSchema(TypedDict, total=False): + type: Required[Literal['format']] + formatting_string: Required[str] + when_used: WhenUsed # default: 'json-unless-none' + + +def format_ser_schema(formatting_string: str, *, when_used: WhenUsed = 'json-unless-none') -> FormatSerSchema: + """ + Returns a schema for serialization using python's `format` method. + + Args: + formatting_string: String defining the format to use + when_used: Same meaning as for [general_function_plain_ser_schema], but with a different default + """ + if when_used == 'json-unless-none': + # just to avoid extra elements in schema, and to use the actual default defined in rust + when_used = None # type: ignore + return _dict_not_none(type='format', formatting_string=formatting_string, when_used=when_used) + + +class ToStringSerSchema(TypedDict, total=False): + type: Required[Literal['to-string']] + when_used: WhenUsed # default: 'json-unless-none' + + +def to_string_ser_schema(*, when_used: WhenUsed = 'json-unless-none') -> ToStringSerSchema: + """ + Returns a schema for serialization using python's `str()` / `__str__` method. + + Args: + when_used: Same meaning as for [general_function_plain_ser_schema], but with a different default + """ + s = dict(type='to-string') + if when_used != 'json-unless-none': + # just to avoid extra elements in schema, and to use the actual default defined in rust + s['when_used'] = when_used + return s # type: ignore + + +class ModelSerSchema(TypedDict, total=False): + type: Required[Literal['model']] + cls: Required[Type[Any]] + schema: Required[CoreSchema] + + +def model_ser_schema(cls: Type[Any], schema: CoreSchema) -> ModelSerSchema: + """ + Returns a schema for serialization using a model. + + Args: + cls: The expected class type, used to generate warnings if the wrong type is passed + schema: Internal schema to use to serialize the model dict + """ + return ModelSerSchema(type='model', cls=cls, schema=schema) + + +SerSchema = Union[ + SimpleSerSchema, + PlainSerializerFunctionSerSchema, + WrapSerializerFunctionSerSchema, + FormatSerSchema, + ToStringSerSchema, + ModelSerSchema, +] + + +class ComputedField(TypedDict, total=False): + type: Required[Literal['computed-field']] + property_name: Required[str] + return_schema: Required[CoreSchema] + alias: str + metadata: Any + + +def computed_field( + property_name: str, return_schema: CoreSchema, *, alias: str | None = None, metadata: Any = None +) -> ComputedField: + """ + ComputedFields are properties of a model or dataclass that are included in serialization. + + Args: + property_name: The name of the property on the model or dataclass + return_schema: The schema used for the type returned by the computed field + alias: The name to use in the serialized output + metadata: Any other information you want to include with the schema, not used by pydantic-core + """ + return _dict_not_none( + type='computed-field', property_name=property_name, return_schema=return_schema, alias=alias, metadata=metadata + ) + + +class AnySchema(TypedDict, total=False): + type: Required[Literal['any']] + ref: str + metadata: Any + serialization: SerSchema + + +def any_schema(*, ref: str | None = None, metadata: Any = None, serialization: SerSchema | None = None) -> AnySchema: + """ + Returns a schema that matches any value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.any_schema() + v = SchemaValidator(schema) + assert v.validate_python(1) == 1 + ``` + + Args: + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none(type='any', ref=ref, metadata=metadata, serialization=serialization) + + +class NoneSchema(TypedDict, total=False): + type: Required[Literal['none']] + ref: str + metadata: Any + serialization: SerSchema + + +def none_schema(*, ref: str | None = None, metadata: Any = None, serialization: SerSchema | None = None) -> NoneSchema: + """ + Returns a schema that matches a None value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.none_schema() + v = SchemaValidator(schema) + assert v.validate_python(None) is None + ``` + + Args: + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none(type='none', ref=ref, metadata=metadata, serialization=serialization) + + +class BoolSchema(TypedDict, total=False): + type: Required[Literal['bool']] + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def bool_schema( + strict: bool | None = None, ref: str | None = None, metadata: Any = None, serialization: SerSchema | None = None +) -> BoolSchema: + """ + Returns a schema that matches a bool value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.bool_schema() + v = SchemaValidator(schema) + assert v.validate_python('True') is True + ``` + + Args: + strict: Whether the value should be a bool or a value that can be converted to a bool + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none(type='bool', strict=strict, ref=ref, metadata=metadata, serialization=serialization) + + +class IntSchema(TypedDict, total=False): + type: Required[Literal['int']] + multiple_of: int + le: int + ge: int + lt: int + gt: int + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def int_schema( + *, + multiple_of: int | None = None, + le: int | None = None, + ge: int | None = None, + lt: int | None = None, + gt: int | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> IntSchema: + """ + Returns a schema that matches a int value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.int_schema(multiple_of=2, le=6, ge=2) + v = SchemaValidator(schema) + assert v.validate_python('4') == 4 + ``` + + Args: + multiple_of: The value must be a multiple of this number + le: The value must be less than or equal to this number + ge: The value must be greater than or equal to this number + lt: The value must be strictly less than this number + gt: The value must be strictly greater than this number + strict: Whether the value should be a int or a value that can be converted to a int + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='int', + multiple_of=multiple_of, + le=le, + ge=ge, + lt=lt, + gt=gt, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class FloatSchema(TypedDict, total=False): + type: Required[Literal['float']] + allow_inf_nan: bool # whether 'NaN', '+inf', '-inf' should be forbidden. default: True + multiple_of: float + le: float + ge: float + lt: float + gt: float + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def float_schema( + *, + allow_inf_nan: bool | None = None, + multiple_of: float | None = None, + le: float | None = None, + ge: float | None = None, + lt: float | None = None, + gt: float | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> FloatSchema: + """ + Returns a schema that matches a float value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.float_schema(le=0.8, ge=0.2) + v = SchemaValidator(schema) + assert v.validate_python('0.5') == 0.5 + ``` + + Args: + allow_inf_nan: Whether to allow inf and nan values + multiple_of: The value must be a multiple of this number + le: The value must be less than or equal to this number + ge: The value must be greater than or equal to this number + lt: The value must be strictly less than this number + gt: The value must be strictly greater than this number + strict: Whether the value should be a float or a value that can be converted to a float + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='float', + allow_inf_nan=allow_inf_nan, + multiple_of=multiple_of, + le=le, + ge=ge, + lt=lt, + gt=gt, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class DecimalSchema(TypedDict, total=False): + type: Required[Literal['decimal']] + allow_inf_nan: bool # whether 'NaN', '+inf', '-inf' should be forbidden. default: False + multiple_of: Decimal + le: Decimal + ge: Decimal + lt: Decimal + gt: Decimal + max_digits: int + decimal_places: int + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def decimal_schema( + *, + allow_inf_nan: bool = None, + multiple_of: Decimal | None = None, + le: Decimal | None = None, + ge: Decimal | None = None, + lt: Decimal | None = None, + gt: Decimal | None = None, + max_digits: int | None = None, + decimal_places: int | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> DecimalSchema: + """ + Returns a schema that matches a decimal value, e.g.: + + ```py + from decimal import Decimal + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.decimal_schema(le=0.8, ge=0.2) + v = SchemaValidator(schema) + assert v.validate_python('0.5') == Decimal('0.5') + ``` + + Args: + allow_inf_nan: Whether to allow inf and nan values + multiple_of: The value must be a multiple of this number + le: The value must be less than or equal to this number + ge: The value must be greater than or equal to this number + lt: The value must be strictly less than this number + gt: The value must be strictly greater than this number + max_digits: The maximum number of decimal digits allowed + decimal_places: The maximum number of decimal places allowed + strict: Whether the value should be a float or a value that can be converted to a float + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='decimal', + gt=gt, + ge=ge, + lt=lt, + le=le, + max_digits=max_digits, + decimal_places=decimal_places, + multiple_of=multiple_of, + allow_inf_nan=allow_inf_nan, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class StringSchema(TypedDict, total=False): + type: Required[Literal['str']] + pattern: str + max_length: int + min_length: int + strip_whitespace: bool + to_lower: bool + to_upper: bool + regex_engine: Literal['rust-regex', 'python-re'] # default: 'rust-regex' + strict: bool + coerce_numbers_to_str: bool + ref: str + metadata: Any + serialization: SerSchema + + +def str_schema( + *, + pattern: str | None = None, + max_length: int | None = None, + min_length: int | None = None, + strip_whitespace: bool | None = None, + to_lower: bool | None = None, + to_upper: bool | None = None, + regex_engine: Literal['rust-regex', 'python-re'] | None = None, + strict: bool | None = None, + coerce_numbers_to_str: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> StringSchema: + """ + Returns a schema that matches a string value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.str_schema(max_length=10, min_length=2) + v = SchemaValidator(schema) + assert v.validate_python('hello') == 'hello' + ``` + + Args: + pattern: A regex pattern that the value must match + max_length: The value must be at most this length + min_length: The value must be at least this length + strip_whitespace: Whether to strip whitespace from the value + to_lower: Whether to convert the value to lowercase + to_upper: Whether to convert the value to uppercase + regex_engine: The regex engine to use for pattern validation. Default is 'rust-regex'. + - `rust-regex` uses the [`regex`](https://docs.rs/regex) Rust + crate, which is non-backtracking and therefore more DDoS + resistant, but does not support all regex features. + - `python-re` use the [`re`](https://docs.python.org/3/library/re.html) module, + which supports all regex features, but may be slower. + strict: Whether the value should be a string or a value that can be converted to a string + coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode). + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='str', + pattern=pattern, + max_length=max_length, + min_length=min_length, + strip_whitespace=strip_whitespace, + to_lower=to_lower, + to_upper=to_upper, + regex_engine=regex_engine, + strict=strict, + coerce_numbers_to_str=coerce_numbers_to_str, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class BytesSchema(TypedDict, total=False): + type: Required[Literal['bytes']] + max_length: int + min_length: int + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def bytes_schema( + *, + max_length: int | None = None, + min_length: int | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> BytesSchema: + """ + Returns a schema that matches a bytes value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.bytes_schema(max_length=10, min_length=2) + v = SchemaValidator(schema) + assert v.validate_python(b'hello') == b'hello' + ``` + + Args: + max_length: The value must be at most this length + min_length: The value must be at least this length + strict: Whether the value should be a bytes or a value that can be converted to a bytes + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='bytes', + max_length=max_length, + min_length=min_length, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class DateSchema(TypedDict, total=False): + type: Required[Literal['date']] + strict: bool + le: date + ge: date + lt: date + gt: date + now_op: Literal['past', 'future'] + # defaults to current local utc offset from `time.localtime().tm_gmtoff` + # value is restricted to -86_400 < offset < 86_400 by bounds in generate_self_schema.py + now_utc_offset: int + ref: str + metadata: Any + serialization: SerSchema + + +def date_schema( + *, + strict: bool | None = None, + le: date | None = None, + ge: date | None = None, + lt: date | None = None, + gt: date | None = None, + now_op: Literal['past', 'future'] | None = None, + now_utc_offset: int | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> DateSchema: + """ + Returns a schema that matches a date value, e.g.: + + ```py + from datetime import date + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.date_schema(le=date(2020, 1, 1), ge=date(2019, 1, 1)) + v = SchemaValidator(schema) + assert v.validate_python(date(2019, 6, 1)) == date(2019, 6, 1) + ``` + + Args: + strict: Whether the value should be a date or a value that can be converted to a date + le: The value must be less than or equal to this date + ge: The value must be greater than or equal to this date + lt: The value must be strictly less than this date + gt: The value must be strictly greater than this date + now_op: The value must be in the past or future relative to the current date + now_utc_offset: The value must be in the past or future relative to the current date with this utc offset + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='date', + strict=strict, + le=le, + ge=ge, + lt=lt, + gt=gt, + now_op=now_op, + now_utc_offset=now_utc_offset, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class TimeSchema(TypedDict, total=False): + type: Required[Literal['time']] + strict: bool + le: time + ge: time + lt: time + gt: time + tz_constraint: Union[Literal['aware', 'naive'], int] + microseconds_precision: Literal['truncate', 'error'] + ref: str + metadata: Any + serialization: SerSchema + + +def time_schema( + *, + strict: bool | None = None, + le: time | None = None, + ge: time | None = None, + lt: time | None = None, + gt: time | None = None, + tz_constraint: Literal['aware', 'naive'] | int | None = None, + microseconds_precision: Literal['truncate', 'error'] = 'truncate', + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> TimeSchema: + """ + Returns a schema that matches a time value, e.g.: + + ```py + from datetime import time + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.time_schema(le=time(12, 0, 0), ge=time(6, 0, 0)) + v = SchemaValidator(schema) + assert v.validate_python(time(9, 0, 0)) == time(9, 0, 0) + ``` + + Args: + strict: Whether the value should be a time or a value that can be converted to a time + le: The value must be less than or equal to this time + ge: The value must be greater than or equal to this time + lt: The value must be strictly less than this time + gt: The value must be strictly greater than this time + tz_constraint: The value must be timezone aware or naive, or an int to indicate required tz offset + microseconds_precision: The behavior when seconds have more than 6 digits or microseconds is too large + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='time', + strict=strict, + le=le, + ge=ge, + lt=lt, + gt=gt, + tz_constraint=tz_constraint, + microseconds_precision=microseconds_precision, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class DatetimeSchema(TypedDict, total=False): + type: Required[Literal['datetime']] + strict: bool + le: datetime + ge: datetime + lt: datetime + gt: datetime + now_op: Literal['past', 'future'] + tz_constraint: Union[Literal['aware', 'naive'], int] + # defaults to current local utc offset from `time.localtime().tm_gmtoff` + # value is restricted to -86_400 < offset < 86_400 by bounds in generate_self_schema.py + now_utc_offset: int + microseconds_precision: Literal['truncate', 'error'] # default: 'truncate' + ref: str + metadata: Any + serialization: SerSchema + + +def datetime_schema( + *, + strict: bool | None = None, + le: datetime | None = None, + ge: datetime | None = None, + lt: datetime | None = None, + gt: datetime | None = None, + now_op: Literal['past', 'future'] | None = None, + tz_constraint: Literal['aware', 'naive'] | int | None = None, + now_utc_offset: int | None = None, + microseconds_precision: Literal['truncate', 'error'] = 'truncate', + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> DatetimeSchema: + """ + Returns a schema that matches a datetime value, e.g.: + + ```py + from datetime import datetime + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.datetime_schema() + v = SchemaValidator(schema) + now = datetime.now() + assert v.validate_python(str(now)) == now + ``` + + Args: + strict: Whether the value should be a datetime or a value that can be converted to a datetime + le: The value must be less than or equal to this datetime + ge: The value must be greater than or equal to this datetime + lt: The value must be strictly less than this datetime + gt: The value must be strictly greater than this datetime + now_op: The value must be in the past or future relative to the current datetime + tz_constraint: The value must be timezone aware or naive, or an int to indicate required tz offset + TODO: use of a tzinfo where offset changes based on the datetime is not yet supported + now_utc_offset: The value must be in the past or future relative to the current datetime with this utc offset + microseconds_precision: The behavior when seconds have more than 6 digits or microseconds is too large + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='datetime', + strict=strict, + le=le, + ge=ge, + lt=lt, + gt=gt, + now_op=now_op, + tz_constraint=tz_constraint, + now_utc_offset=now_utc_offset, + microseconds_precision=microseconds_precision, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class TimedeltaSchema(TypedDict, total=False): + type: Required[Literal['timedelta']] + strict: bool + le: timedelta + ge: timedelta + lt: timedelta + gt: timedelta + microseconds_precision: Literal['truncate', 'error'] + ref: str + metadata: Any + serialization: SerSchema + + +def timedelta_schema( + *, + strict: bool | None = None, + le: timedelta | None = None, + ge: timedelta | None = None, + lt: timedelta | None = None, + gt: timedelta | None = None, + microseconds_precision: Literal['truncate', 'error'] = 'truncate', + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> TimedeltaSchema: + """ + Returns a schema that matches a timedelta value, e.g.: + + ```py + from datetime import timedelta + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.timedelta_schema(le=timedelta(days=1), ge=timedelta(days=0)) + v = SchemaValidator(schema) + assert v.validate_python(timedelta(hours=12)) == timedelta(hours=12) + ``` + + Args: + strict: Whether the value should be a timedelta or a value that can be converted to a timedelta + le: The value must be less than or equal to this timedelta + ge: The value must be greater than or equal to this timedelta + lt: The value must be strictly less than this timedelta + gt: The value must be strictly greater than this timedelta + microseconds_precision: The behavior when seconds have more than 6 digits or microseconds is too large + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='timedelta', + strict=strict, + le=le, + ge=ge, + lt=lt, + gt=gt, + microseconds_precision=microseconds_precision, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class LiteralSchema(TypedDict, total=False): + type: Required[Literal['literal']] + expected: Required[List[Any]] + ref: str + metadata: Any + serialization: SerSchema + + +def literal_schema( + expected: list[Any], *, ref: str | None = None, metadata: Any = None, serialization: SerSchema | None = None +) -> LiteralSchema: + """ + Returns a schema that matches a literal value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.literal_schema(['hello', 'world']) + v = SchemaValidator(schema) + assert v.validate_python('hello') == 'hello' + ``` + + Args: + expected: The value must be one of these values + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none(type='literal', expected=expected, ref=ref, metadata=metadata, serialization=serialization) + + +class EnumSchema(TypedDict, total=False): + type: Required[Literal['enum']] + cls: Required[Any] + members: Required[List[Any]] + sub_type: Literal['str', 'int', 'float'] + missing: Callable[[Any], Any] + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def enum_schema( + cls: Any, + members: list[Any], + *, + sub_type: Literal['str', 'int', 'float'] | None = None, + missing: Callable[[Any], Any] | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> EnumSchema: + """ + Returns a schema that matches an enum value, e.g.: + + ```py + from enum import Enum + from pydantic_core import SchemaValidator, core_schema + + class Color(Enum): + RED = 1 + GREEN = 2 + BLUE = 3 + + schema = core_schema.enum_schema(Color, list(Color.__members__.values())) + v = SchemaValidator(schema) + assert v.validate_python(2) is Color.GREEN + ``` + + Args: + cls: The enum class + members: The members of the enum, generally `list(MyEnum.__members__.values())` + sub_type: The type of the enum, either 'str' or 'int' or None for plain enums + missing: A function to use when the value is not found in the enum, from `_missing_` + strict: Whether to use strict mode, defaults to False + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='enum', + cls=cls, + members=members, + sub_type=sub_type, + missing=missing, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +# must match input/parse_json.rs::JsonType::try_from +JsonType = Literal['null', 'bool', 'int', 'float', 'str', 'list', 'dict'] + + +class IsInstanceSchema(TypedDict, total=False): + type: Required[Literal['is-instance']] + cls: Required[Any] + cls_repr: str + ref: str + metadata: Any + serialization: SerSchema + + +def is_instance_schema( + cls: Any, + *, + cls_repr: str | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> IsInstanceSchema: + """ + Returns a schema that checks if a value is an instance of a class, equivalent to python's `isinstance` method, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + class A: + pass + + schema = core_schema.is_instance_schema(cls=A) + v = SchemaValidator(schema) + v.validate_python(A()) + ``` + + Args: + cls: The value must be an instance of this class + cls_repr: If provided this string is used in the validator name instead of `repr(cls)` + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='is-instance', cls=cls, cls_repr=cls_repr, ref=ref, metadata=metadata, serialization=serialization + ) + + +class IsSubclassSchema(TypedDict, total=False): + type: Required[Literal['is-subclass']] + cls: Required[Type[Any]] + cls_repr: str + ref: str + metadata: Any + serialization: SerSchema + + +def is_subclass_schema( + cls: Type[Any], + *, + cls_repr: str | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> IsInstanceSchema: + """ + Returns a schema that checks if a value is a subtype of a class, equivalent to python's `issubclass` method, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + class A: + pass + + class B(A): + pass + + schema = core_schema.is_subclass_schema(cls=A) + v = SchemaValidator(schema) + v.validate_python(B) + ``` + + Args: + cls: The value must be a subclass of this class + cls_repr: If provided this string is used in the validator name instead of `repr(cls)` + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='is-subclass', cls=cls, cls_repr=cls_repr, ref=ref, metadata=metadata, serialization=serialization + ) + + +class CallableSchema(TypedDict, total=False): + type: Required[Literal['callable']] + ref: str + metadata: Any + serialization: SerSchema + + +def callable_schema( + *, ref: str | None = None, metadata: Any = None, serialization: SerSchema | None = None +) -> CallableSchema: + """ + Returns a schema that checks if a value is callable, equivalent to python's `callable` method, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.callable_schema() + v = SchemaValidator(schema) + v.validate_python(min) + ``` + + Args: + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none(type='callable', ref=ref, metadata=metadata, serialization=serialization) + + +class UuidSchema(TypedDict, total=False): + type: Required[Literal['uuid']] + version: Literal[1, 3, 4, 5] + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def uuid_schema( + *, + version: Literal[1, 3, 4, 5] | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> UuidSchema: + return _dict_not_none( + type='uuid', version=version, strict=strict, ref=ref, metadata=metadata, serialization=serialization + ) + + +class IncExSeqSerSchema(TypedDict, total=False): + type: Required[Literal['include-exclude-sequence']] + include: Set[int] + exclude: Set[int] + + +def filter_seq_schema(*, include: Set[int] | None = None, exclude: Set[int] | None = None) -> IncExSeqSerSchema: + return _dict_not_none(type='include-exclude-sequence', include=include, exclude=exclude) + + +IncExSeqOrElseSerSchema = Union[IncExSeqSerSchema, SerSchema] + + +class ListSchema(TypedDict, total=False): + type: Required[Literal['list']] + items_schema: CoreSchema + min_length: int + max_length: int + strict: bool + ref: str + metadata: Any + serialization: IncExSeqOrElseSerSchema + + +def list_schema( + items_schema: CoreSchema | None = None, + *, + min_length: int | None = None, + max_length: int | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: IncExSeqOrElseSerSchema | None = None, +) -> ListSchema: + """ + Returns a schema that matches a list value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.list_schema(core_schema.int_schema(), min_length=0, max_length=10) + v = SchemaValidator(schema) + assert v.validate_python(['4']) == [4] + ``` + + Args: + items_schema: The value must be a list of items that match this schema + min_length: The value must be a list with at least this many items + max_length: The value must be a list with at most this many items + strict: The value must be a list with exactly this many items + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='list', + items_schema=items_schema, + min_length=min_length, + max_length=max_length, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +# @deprecated('tuple_positional_schema is deprecated. Use pydantic_core.core_schema.tuple_schema instead.') +def tuple_positional_schema( + items_schema: list[CoreSchema], + *, + extras_schema: CoreSchema | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: IncExSeqOrElseSerSchema | None = None, +) -> TupleSchema: + """ + Returns a schema that matches a tuple of schemas, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.tuple_positional_schema( + [core_schema.int_schema(), core_schema.str_schema()] + ) + v = SchemaValidator(schema) + assert v.validate_python((1, 'hello')) == (1, 'hello') + ``` + + Args: + items_schema: The value must be a tuple with items that match these schemas + extras_schema: The value must be a tuple with items that match this schema + This was inspired by JSON schema's `prefixItems` and `items` fields. + In python's `typing.Tuple`, you can't specify a type for "extra" items -- they must all be the same type + if the length is variable. So this field won't be set from a `typing.Tuple` annotation on a pydantic model. + strict: The value must be a tuple with exactly this many items + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + if extras_schema is not None: + variadic_item_index = len(items_schema) + items_schema = items_schema + [extras_schema] + else: + variadic_item_index = None + return tuple_schema( + items_schema=items_schema, + variadic_item_index=variadic_item_index, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +# @deprecated('tuple_variable_schema is deprecated. Use pydantic_core.core_schema.tuple_schema instead.') +def tuple_variable_schema( + items_schema: CoreSchema | None = None, + *, + min_length: int | None = None, + max_length: int | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: IncExSeqOrElseSerSchema | None = None, +) -> TupleSchema: + """ + Returns a schema that matches a tuple of a given schema, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.tuple_variable_schema( + items_schema=core_schema.int_schema(), min_length=0, max_length=10 + ) + v = SchemaValidator(schema) + assert v.validate_python(('1', 2, 3)) == (1, 2, 3) + ``` + + Args: + items_schema: The value must be a tuple with items that match this schema + min_length: The value must be a tuple with at least this many items + max_length: The value must be a tuple with at most this many items + strict: The value must be a tuple with exactly this many items + ref: Optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return tuple_schema( + items_schema=[items_schema or any_schema()], + variadic_item_index=0, + min_length=min_length, + max_length=max_length, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class TupleSchema(TypedDict, total=False): + type: Required[Literal['tuple']] + items_schema: Required[List[CoreSchema]] + variadic_item_index: int + min_length: int + max_length: int + strict: bool + ref: str + metadata: Any + serialization: IncExSeqOrElseSerSchema + + +def tuple_schema( + items_schema: list[CoreSchema], + *, + variadic_item_index: int | None = None, + min_length: int | None = None, + max_length: int | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: IncExSeqOrElseSerSchema | None = None, +) -> TupleSchema: + """ + Returns a schema that matches a tuple of schemas, with an optional variadic item, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.tuple_schema( + [core_schema.int_schema(), core_schema.str_schema(), core_schema.float_schema()], + variadic_item_index=1, + ) + v = SchemaValidator(schema) + assert v.validate_python((1, 'hello', 'world', 1.5)) == (1, 'hello', 'world', 1.5) + ``` + + Args: + items_schema: The value must be a tuple with items that match these schemas + variadic_item_index: The index of the schema in `items_schema` to be treated as variadic (following PEP 646) + min_length: The value must be a tuple with at least this many items + max_length: The value must be a tuple with at most this many items + strict: The value must be a tuple with exactly this many items + ref: Optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='tuple', + items_schema=items_schema, + variadic_item_index=variadic_item_index, + min_length=min_length, + max_length=max_length, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class SetSchema(TypedDict, total=False): + type: Required[Literal['set']] + items_schema: CoreSchema + min_length: int + max_length: int + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def set_schema( + items_schema: CoreSchema | None = None, + *, + min_length: int | None = None, + max_length: int | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> SetSchema: + """ + Returns a schema that matches a set of a given schema, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.set_schema( + items_schema=core_schema.int_schema(), min_length=0, max_length=10 + ) + v = SchemaValidator(schema) + assert v.validate_python({1, '2', 3}) == {1, 2, 3} + ``` + + Args: + items_schema: The value must be a set with items that match this schema + min_length: The value must be a set with at least this many items + max_length: The value must be a set with at most this many items + strict: The value must be a set with exactly this many items + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='set', + items_schema=items_schema, + min_length=min_length, + max_length=max_length, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class FrozenSetSchema(TypedDict, total=False): + type: Required[Literal['frozenset']] + items_schema: CoreSchema + min_length: int + max_length: int + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def frozenset_schema( + items_schema: CoreSchema | None = None, + *, + min_length: int | None = None, + max_length: int | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> FrozenSetSchema: + """ + Returns a schema that matches a frozenset of a given schema, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.frozenset_schema( + items_schema=core_schema.int_schema(), min_length=0, max_length=10 + ) + v = SchemaValidator(schema) + assert v.validate_python(frozenset(range(3))) == frozenset({0, 1, 2}) + ``` + + Args: + items_schema: The value must be a frozenset with items that match this schema + min_length: The value must be a frozenset with at least this many items + max_length: The value must be a frozenset with at most this many items + strict: The value must be a frozenset with exactly this many items + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='frozenset', + items_schema=items_schema, + min_length=min_length, + max_length=max_length, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class GeneratorSchema(TypedDict, total=False): + type: Required[Literal['generator']] + items_schema: CoreSchema + min_length: int + max_length: int + ref: str + metadata: Any + serialization: IncExSeqOrElseSerSchema + + +def generator_schema( + items_schema: CoreSchema | None = None, + *, + min_length: int | None = None, + max_length: int | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: IncExSeqOrElseSerSchema | None = None, +) -> GeneratorSchema: + """ + Returns a schema that matches a generator value, e.g.: + + ```py + from typing import Iterator + from pydantic_core import SchemaValidator, core_schema + + def gen() -> Iterator[int]: + yield 1 + + schema = core_schema.generator_schema(items_schema=core_schema.int_schema()) + v = SchemaValidator(schema) + v.validate_python(gen()) + ``` + + Unlike other types, validated generators do not raise ValidationErrors eagerly, + but instead will raise a ValidationError when a violating value is actually read from the generator. + This is to ensure that "validated" generators retain the benefit of lazy evaluation. + + Args: + items_schema: The value must be a generator with items that match this schema + min_length: The value must be a generator that yields at least this many items + max_length: The value must be a generator that yields at most this many items + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='generator', + items_schema=items_schema, + min_length=min_length, + max_length=max_length, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +IncExDict = Set[Union[int, str]] + + +class IncExDictSerSchema(TypedDict, total=False): + type: Required[Literal['include-exclude-dict']] + include: IncExDict + exclude: IncExDict + + +def filter_dict_schema(*, include: IncExDict | None = None, exclude: IncExDict | None = None) -> IncExDictSerSchema: + return _dict_not_none(type='include-exclude-dict', include=include, exclude=exclude) + + +IncExDictOrElseSerSchema = Union[IncExDictSerSchema, SerSchema] + + +class DictSchema(TypedDict, total=False): + type: Required[Literal['dict']] + keys_schema: CoreSchema # default: AnySchema + values_schema: CoreSchema # default: AnySchema + min_length: int + max_length: int + strict: bool + ref: str + metadata: Any + serialization: IncExDictOrElseSerSchema + + +def dict_schema( + keys_schema: CoreSchema | None = None, + values_schema: CoreSchema | None = None, + *, + min_length: int | None = None, + max_length: int | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> DictSchema: + """ + Returns a schema that matches a dict value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.dict_schema( + keys_schema=core_schema.str_schema(), values_schema=core_schema.int_schema() + ) + v = SchemaValidator(schema) + assert v.validate_python({'a': '1', 'b': 2}) == {'a': 1, 'b': 2} + ``` + + Args: + keys_schema: The value must be a dict with keys that match this schema + values_schema: The value must be a dict with values that match this schema + min_length: The value must be a dict with at least this many items + max_length: The value must be a dict with at most this many items + strict: Whether the keys and values should be validated with strict mode + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='dict', + keys_schema=keys_schema, + values_schema=values_schema, + min_length=min_length, + max_length=max_length, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +# (input_value: Any, /) -> Any +NoInfoValidatorFunction = Callable[[Any], Any] + + +class NoInfoValidatorFunctionSchema(TypedDict): + type: Literal['no-info'] + function: NoInfoValidatorFunction + + +# (input_value: Any, info: ValidationInfo, /) -> Any +WithInfoValidatorFunction = Callable[[Any, ValidationInfo], Any] + + +class WithInfoValidatorFunctionSchema(TypedDict, total=False): + type: Required[Literal['with-info']] + function: Required[WithInfoValidatorFunction] + field_name: str + + +ValidationFunction = Union[NoInfoValidatorFunctionSchema, WithInfoValidatorFunctionSchema] + + +class _ValidatorFunctionSchema(TypedDict, total=False): + function: Required[ValidationFunction] + schema: Required[CoreSchema] + ref: str + metadata: Any + serialization: SerSchema + + +class BeforeValidatorFunctionSchema(_ValidatorFunctionSchema, total=False): + type: Required[Literal['function-before']] + + +def no_info_before_validator_function( + function: NoInfoValidatorFunction, + schema: CoreSchema, + *, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> BeforeValidatorFunctionSchema: + """ + Returns a schema that calls a validator function before validating, no `info` argument is provided, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn(v: bytes) -> str: + return v.decode() + 'world' + + func_schema = core_schema.no_info_before_validator_function( + function=fn, schema=core_schema.str_schema() + ) + schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)}) + + v = SchemaValidator(schema) + assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'} + ``` + + Args: + function: The validator function to call + schema: The schema to validate the output of the validator function + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='function-before', + function={'type': 'no-info', 'function': function}, + schema=schema, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +def with_info_before_validator_function( + function: WithInfoValidatorFunction, + schema: CoreSchema, + *, + field_name: str | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> BeforeValidatorFunctionSchema: + """ + Returns a schema that calls a validator function before validation, the function is called with + an `info` argument, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn(v: bytes, info: core_schema.ValidationInfo) -> str: + assert info.data is not None + assert info.field_name is not None + return v.decode() + 'world' + + func_schema = core_schema.with_info_before_validator_function( + function=fn, schema=core_schema.str_schema(), field_name='a' + ) + schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)}) + + v = SchemaValidator(schema) + assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'} + ``` + + Args: + function: The validator function to call + field_name: The name of the field + schema: The schema to validate the output of the validator function + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='function-before', + function=_dict_not_none(type='with-info', function=function, field_name=field_name), + schema=schema, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class AfterValidatorFunctionSchema(_ValidatorFunctionSchema, total=False): + type: Required[Literal['function-after']] + + +def no_info_after_validator_function( + function: NoInfoValidatorFunction, + schema: CoreSchema, + *, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> AfterValidatorFunctionSchema: + """ + Returns a schema that calls a validator function after validating, no `info` argument is provided, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn(v: str) -> str: + return v + 'world' + + func_schema = core_schema.no_info_after_validator_function(fn, core_schema.str_schema()) + schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)}) + + v = SchemaValidator(schema) + assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'} + ``` + + Args: + function: The validator function to call after the schema is validated + schema: The schema to validate before the validator function + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='function-after', + function={'type': 'no-info', 'function': function}, + schema=schema, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +def with_info_after_validator_function( + function: WithInfoValidatorFunction, + schema: CoreSchema, + *, + field_name: str | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> AfterValidatorFunctionSchema: + """ + Returns a schema that calls a validator function after validation, the function is called with + an `info` argument, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn(v: str, info: core_schema.ValidationInfo) -> str: + assert info.data is not None + assert info.field_name is not None + return v + 'world' + + func_schema = core_schema.with_info_after_validator_function( + function=fn, schema=core_schema.str_schema(), field_name='a' + ) + schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)}) + + v = SchemaValidator(schema) + assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'} + ``` + + Args: + function: The validator function to call after the schema is validated + schema: The schema to validate before the validator function + field_name: The name of the field this validators is applied to, if any + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='function-after', + function=_dict_not_none(type='with-info', function=function, field_name=field_name), + schema=schema, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class ValidatorFunctionWrapHandler(Protocol): + def __call__(self, input_value: Any, outer_location: str | int | None = None) -> Any: # pragma: no cover + ... + + +# (input_value: Any, validator: ValidatorFunctionWrapHandler, /) -> Any +NoInfoWrapValidatorFunction = Callable[[Any, ValidatorFunctionWrapHandler], Any] + + +class NoInfoWrapValidatorFunctionSchema(TypedDict): + type: Literal['no-info'] + function: NoInfoWrapValidatorFunction + + +# (input_value: Any, validator: ValidatorFunctionWrapHandler, info: ValidationInfo, /) -> Any +WithInfoWrapValidatorFunction = Callable[[Any, ValidatorFunctionWrapHandler, ValidationInfo], Any] + + +class WithInfoWrapValidatorFunctionSchema(TypedDict, total=False): + type: Required[Literal['with-info']] + function: Required[WithInfoWrapValidatorFunction] + field_name: str + + +WrapValidatorFunction = Union[NoInfoWrapValidatorFunctionSchema, WithInfoWrapValidatorFunctionSchema] + + +class WrapValidatorFunctionSchema(TypedDict, total=False): + type: Required[Literal['function-wrap']] + function: Required[WrapValidatorFunction] + schema: Required[CoreSchema] + ref: str + metadata: Any + serialization: SerSchema + + +def no_info_wrap_validator_function( + function: NoInfoWrapValidatorFunction, + schema: CoreSchema, + *, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> WrapValidatorFunctionSchema: + """ + Returns a schema which calls a function with a `validator` callable argument which can + optionally be used to call inner validation with the function logic, this is much like the + "onion" implementation of middleware in many popular web frameworks, no `info` argument is passed, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn( + v: str, + validator: core_schema.ValidatorFunctionWrapHandler, + ) -> str: + return validator(input_value=v) + 'world' + + schema = core_schema.no_info_wrap_validator_function( + function=fn, schema=core_schema.str_schema() + ) + v = SchemaValidator(schema) + assert v.validate_python('hello ') == 'hello world' + ``` + + Args: + function: The validator function to call + schema: The schema to validate the output of the validator function + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='function-wrap', + function={'type': 'no-info', 'function': function}, + schema=schema, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +def with_info_wrap_validator_function( + function: WithInfoWrapValidatorFunction, + schema: CoreSchema, + *, + field_name: str | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> WrapValidatorFunctionSchema: + """ + Returns a schema which calls a function with a `validator` callable argument which can + optionally be used to call inner validation with the function logic, this is much like the + "onion" implementation of middleware in many popular web frameworks, an `info` argument is also passed, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn( + v: str, + validator: core_schema.ValidatorFunctionWrapHandler, + info: core_schema.ValidationInfo, + ) -> str: + return validator(input_value=v) + 'world' + + schema = core_schema.with_info_wrap_validator_function( + function=fn, schema=core_schema.str_schema() + ) + v = SchemaValidator(schema) + assert v.validate_python('hello ') == 'hello world' + ``` + + Args: + function: The validator function to call + schema: The schema to validate the output of the validator function + field_name: The name of the field this validators is applied to, if any + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='function-wrap', + function=_dict_not_none(type='with-info', function=function, field_name=field_name), + schema=schema, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class PlainValidatorFunctionSchema(TypedDict, total=False): + type: Required[Literal['function-plain']] + function: Required[ValidationFunction] + ref: str + metadata: Any + serialization: SerSchema + + +def no_info_plain_validator_function( + function: NoInfoValidatorFunction, + *, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> PlainValidatorFunctionSchema: + """ + Returns a schema that uses the provided function for validation, no `info` argument is passed, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn(v: str) -> str: + assert 'hello' in v + return v + 'world' + + schema = core_schema.no_info_plain_validator_function(function=fn) + v = SchemaValidator(schema) + assert v.validate_python('hello ') == 'hello world' + ``` + + Args: + function: The validator function to call + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='function-plain', + function={'type': 'no-info', 'function': function}, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +def with_info_plain_validator_function( + function: WithInfoValidatorFunction, + *, + field_name: str | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> PlainValidatorFunctionSchema: + """ + Returns a schema that uses the provided function for validation, an `info` argument is passed, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn(v: str, info: core_schema.ValidationInfo) -> str: + assert 'hello' in v + return v + 'world' + + schema = core_schema.with_info_plain_validator_function(function=fn) + v = SchemaValidator(schema) + assert v.validate_python('hello ') == 'hello world' + ``` + + Args: + function: The validator function to call + field_name: The name of the field this validators is applied to, if any + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='function-plain', + function=_dict_not_none(type='with-info', function=function, field_name=field_name), + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class WithDefaultSchema(TypedDict, total=False): + type: Required[Literal['default']] + schema: Required[CoreSchema] + default: Any + default_factory: Callable[[], Any] + on_error: Literal['raise', 'omit', 'default'] # default: 'raise' + validate_default: bool # default: False + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def with_default_schema( + schema: CoreSchema, + *, + default: Any = PydanticUndefined, + default_factory: Callable[[], Any] | None = None, + on_error: Literal['raise', 'omit', 'default'] | None = None, + validate_default: bool | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> WithDefaultSchema: + """ + Returns a schema that adds a default value to the given schema, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.with_default_schema(core_schema.str_schema(), default='hello') + wrapper_schema = core_schema.typed_dict_schema( + {'a': core_schema.typed_dict_field(schema)} + ) + v = SchemaValidator(wrapper_schema) + assert v.validate_python({}) == v.validate_python({'a': 'hello'}) + ``` + + Args: + schema: The schema to add a default value to + default: The default value to use + default_factory: A function that returns the default value to use + on_error: What to do if the schema validation fails. One of 'raise', 'omit', 'default' + validate_default: Whether the default value should be validated + strict: Whether the underlying schema should be validated with strict mode + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + s = _dict_not_none( + type='default', + schema=schema, + default_factory=default_factory, + on_error=on_error, + validate_default=validate_default, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + if default is not PydanticUndefined: + s['default'] = default + return s + + +class NullableSchema(TypedDict, total=False): + type: Required[Literal['nullable']] + schema: Required[CoreSchema] + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def nullable_schema( + schema: CoreSchema, + *, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> NullableSchema: + """ + Returns a schema that matches a nullable value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.nullable_schema(core_schema.str_schema()) + v = SchemaValidator(schema) + assert v.validate_python(None) is None + ``` + + Args: + schema: The schema to wrap + strict: Whether the underlying schema should be validated with strict mode + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='nullable', schema=schema, strict=strict, ref=ref, metadata=metadata, serialization=serialization + ) + + +class UnionSchema(TypedDict, total=False): + type: Required[Literal['union']] + choices: Required[List[Union[CoreSchema, Tuple[CoreSchema, str]]]] + # default true, whether to automatically collapse unions with one element to the inner validator + auto_collapse: bool + custom_error_type: str + custom_error_message: str + custom_error_context: Dict[str, Union[str, int, float]] + mode: Literal['smart', 'left_to_right'] # default: 'smart' + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def union_schema( + choices: list[CoreSchema | tuple[CoreSchema, str]], + *, + auto_collapse: bool | None = None, + custom_error_type: str | None = None, + custom_error_message: str | None = None, + custom_error_context: dict[str, str | int] | None = None, + mode: Literal['smart', 'left_to_right'] | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> UnionSchema: + """ + Returns a schema that matches a union value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.union_schema([core_schema.str_schema(), core_schema.int_schema()]) + v = SchemaValidator(schema) + assert v.validate_python('hello') == 'hello' + assert v.validate_python(1) == 1 + ``` + + Args: + choices: The schemas to match. If a tuple, the second item is used as the label for the case. + auto_collapse: whether to automatically collapse unions with one element to the inner validator, default true + custom_error_type: The custom error type to use if the validation fails + custom_error_message: The custom error message to use if the validation fails + custom_error_context: The custom error context to use if the validation fails + mode: How to select which choice to return + * `smart` (default) will try to return the choice which is the closest match to the input value + * `left_to_right` will return the first choice in `choices` which succeeds validation + strict: Whether the underlying schemas should be validated with strict mode + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='union', + choices=choices, + auto_collapse=auto_collapse, + custom_error_type=custom_error_type, + custom_error_message=custom_error_message, + custom_error_context=custom_error_context, + mode=mode, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class TaggedUnionSchema(TypedDict, total=False): + type: Required[Literal['tagged-union']] + choices: Required[Dict[Hashable, CoreSchema]] + discriminator: Required[Union[str, List[Union[str, int]], List[List[Union[str, int]]], Callable[[Any], Hashable]]] + custom_error_type: str + custom_error_message: str + custom_error_context: Dict[str, Union[str, int, float]] + strict: bool + from_attributes: bool # default: True + ref: str + metadata: Any + serialization: SerSchema + + +def tagged_union_schema( + choices: Dict[Hashable, CoreSchema], + discriminator: str | list[str | int] | list[list[str | int]] | Callable[[Any], Hashable], + *, + custom_error_type: str | None = None, + custom_error_message: str | None = None, + custom_error_context: dict[str, int | str | float] | None = None, + strict: bool | None = None, + from_attributes: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> TaggedUnionSchema: + """ + Returns a schema that matches a tagged union value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + apple_schema = core_schema.typed_dict_schema( + { + 'foo': core_schema.typed_dict_field(core_schema.str_schema()), + 'bar': core_schema.typed_dict_field(core_schema.int_schema()), + } + ) + banana_schema = core_schema.typed_dict_schema( + { + 'foo': core_schema.typed_dict_field(core_schema.str_schema()), + 'spam': core_schema.typed_dict_field( + core_schema.list_schema(items_schema=core_schema.int_schema()) + ), + } + ) + schema = core_schema.tagged_union_schema( + choices={ + 'apple': apple_schema, + 'banana': banana_schema, + }, + discriminator='foo', + ) + v = SchemaValidator(schema) + assert v.validate_python({'foo': 'apple', 'bar': '123'}) == {'foo': 'apple', 'bar': 123} + assert v.validate_python({'foo': 'banana', 'spam': [1, 2, 3]}) == { + 'foo': 'banana', + 'spam': [1, 2, 3], + } + ``` + + Args: + choices: The schemas to match + When retrieving a schema from `choices` using the discriminator value, if the value is a str, + it should be fed back into the `choices` map until a schema is obtained + (This approach is to prevent multiple ownership of a single schema in Rust) + discriminator: The discriminator to use to determine the schema to use + * If `discriminator` is a str, it is the name of the attribute to use as the discriminator + * If `discriminator` is a list of int/str, it should be used as a "path" to access the discriminator + * If `discriminator` is a list of lists, each inner list is a path, and the first path that exists is used + * If `discriminator` is a callable, it should return the discriminator when called on the value to validate; + the callable can return `None` to indicate that there is no matching discriminator present on the input + custom_error_type: The custom error type to use if the validation fails + custom_error_message: The custom error message to use if the validation fails + custom_error_context: The custom error context to use if the validation fails + strict: Whether the underlying schemas should be validated with strict mode + from_attributes: Whether to use the attributes of the object to retrieve the discriminator value + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='tagged-union', + choices=choices, + discriminator=discriminator, + custom_error_type=custom_error_type, + custom_error_message=custom_error_message, + custom_error_context=custom_error_context, + strict=strict, + from_attributes=from_attributes, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class ChainSchema(TypedDict, total=False): + type: Required[Literal['chain']] + steps: Required[List[CoreSchema]] + ref: str + metadata: Any + serialization: SerSchema + + +def chain_schema( + steps: list[CoreSchema], *, ref: str | None = None, metadata: Any = None, serialization: SerSchema | None = None +) -> ChainSchema: + """ + Returns a schema that chains the provided validation schemas, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn(v: str, info: core_schema.ValidationInfo) -> str: + assert 'hello' in v + return v + ' world' + + fn_schema = core_schema.with_info_plain_validator_function(function=fn) + schema = core_schema.chain_schema( + [fn_schema, fn_schema, fn_schema, core_schema.str_schema()] + ) + v = SchemaValidator(schema) + assert v.validate_python('hello') == 'hello world world world' + ``` + + Args: + steps: The schemas to chain + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none(type='chain', steps=steps, ref=ref, metadata=metadata, serialization=serialization) + + +class LaxOrStrictSchema(TypedDict, total=False): + type: Required[Literal['lax-or-strict']] + lax_schema: Required[CoreSchema] + strict_schema: Required[CoreSchema] + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def lax_or_strict_schema( + lax_schema: CoreSchema, + strict_schema: CoreSchema, + *, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> LaxOrStrictSchema: + """ + Returns a schema that uses the lax or strict schema, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + def fn(v: str, info: core_schema.ValidationInfo) -> str: + assert 'hello' in v + return v + ' world' + + lax_schema = core_schema.int_schema(strict=False) + strict_schema = core_schema.int_schema(strict=True) + + schema = core_schema.lax_or_strict_schema( + lax_schema=lax_schema, strict_schema=strict_schema, strict=True + ) + v = SchemaValidator(schema) + assert v.validate_python(123) == 123 + + schema = core_schema.lax_or_strict_schema( + lax_schema=lax_schema, strict_schema=strict_schema, strict=False + ) + v = SchemaValidator(schema) + assert v.validate_python('123') == 123 + ``` + + Args: + lax_schema: The lax schema to use + strict_schema: The strict schema to use + strict: Whether the strict schema should be used + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='lax-or-strict', + lax_schema=lax_schema, + strict_schema=strict_schema, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class JsonOrPythonSchema(TypedDict, total=False): + type: Required[Literal['json-or-python']] + json_schema: Required[CoreSchema] + python_schema: Required[CoreSchema] + ref: str + metadata: Any + serialization: SerSchema + + +def json_or_python_schema( + json_schema: CoreSchema, + python_schema: CoreSchema, + *, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> JsonOrPythonSchema: + """ + Returns a schema that uses the Json or Python schema depending on the input: + + ```py + from pydantic_core import SchemaValidator, ValidationError, core_schema + + v = SchemaValidator( + core_schema.json_or_python_schema( + json_schema=core_schema.int_schema(), + python_schema=core_schema.int_schema(strict=True), + ) + ) + + assert v.validate_json('"123"') == 123 + + try: + v.validate_python('123') + except ValidationError: + pass + else: + raise AssertionError('Validation should have failed') + ``` + + Args: + json_schema: The schema to use for Json inputs + python_schema: The schema to use for Python inputs + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='json-or-python', + json_schema=json_schema, + python_schema=python_schema, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class TypedDictField(TypedDict, total=False): + type: Required[Literal['typed-dict-field']] + schema: Required[CoreSchema] + required: bool + validation_alias: Union[str, List[Union[str, int]], List[List[Union[str, int]]]] + serialization_alias: str + serialization_exclude: bool # default: False + metadata: Any + + +def typed_dict_field( + schema: CoreSchema, + *, + required: bool | None = None, + validation_alias: str | list[str | int] | list[list[str | int]] | None = None, + serialization_alias: str | None = None, + serialization_exclude: bool | None = None, + metadata: Any = None, +) -> TypedDictField: + """ + Returns a schema that matches a typed dict field, e.g.: + + ```py + from pydantic_core import core_schema + + field = core_schema.typed_dict_field(schema=core_schema.int_schema(), required=True) + ``` + + Args: + schema: The schema to use for the field + required: Whether the field is required + validation_alias: The alias(es) to use to find the field in the validation data + serialization_alias: The alias to use as a key when serializing + serialization_exclude: Whether to exclude the field when serializing + metadata: Any other information you want to include with the schema, not used by pydantic-core + """ + return _dict_not_none( + type='typed-dict-field', + schema=schema, + required=required, + validation_alias=validation_alias, + serialization_alias=serialization_alias, + serialization_exclude=serialization_exclude, + metadata=metadata, + ) + + +class TypedDictSchema(TypedDict, total=False): + type: Required[Literal['typed-dict']] + fields: Required[Dict[str, TypedDictField]] + computed_fields: List[ComputedField] + strict: bool + extras_schema: CoreSchema + # all these values can be set via config, equivalent fields have `typed_dict_` prefix + extra_behavior: ExtraBehavior + total: bool # default: True + populate_by_name: bool # replaces `allow_population_by_field_name` in pydantic v1 + ref: str + metadata: Any + serialization: SerSchema + config: CoreConfig + + +def typed_dict_schema( + fields: Dict[str, TypedDictField], + *, + computed_fields: list[ComputedField] | None = None, + strict: bool | None = None, + extras_schema: CoreSchema | None = None, + extra_behavior: ExtraBehavior | None = None, + total: bool | None = None, + populate_by_name: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, + config: CoreConfig | None = None, +) -> TypedDictSchema: + """ + Returns a schema that matches a typed dict, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + wrapper_schema = core_schema.typed_dict_schema( + {'a': core_schema.typed_dict_field(core_schema.str_schema())} + ) + v = SchemaValidator(wrapper_schema) + assert v.validate_python({'a': 'hello'}) == {'a': 'hello'} + ``` + + Args: + fields: The fields to use for the typed dict + computed_fields: Computed fields to use when serializing the model, only applies when directly inside a model + strict: Whether the typed dict is strict + extras_schema: The extra validator to use for the typed dict + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + extra_behavior: The extra behavior to use for the typed dict + total: Whether the typed dict is total + populate_by_name: Whether the typed dict should populate by name + serialization: Custom serialization schema + """ + return _dict_not_none( + type='typed-dict', + fields=fields, + computed_fields=computed_fields, + strict=strict, + extras_schema=extras_schema, + extra_behavior=extra_behavior, + total=total, + populate_by_name=populate_by_name, + ref=ref, + metadata=metadata, + serialization=serialization, + config=config, + ) + + +class ModelField(TypedDict, total=False): + type: Required[Literal['model-field']] + schema: Required[CoreSchema] + validation_alias: Union[str, List[Union[str, int]], List[List[Union[str, int]]]] + serialization_alias: str + serialization_exclude: bool # default: False + frozen: bool + metadata: Any + + +def model_field( + schema: CoreSchema, + *, + validation_alias: str | list[str | int] | list[list[str | int]] | None = None, + serialization_alias: str | None = None, + serialization_exclude: bool | None = None, + frozen: bool | None = None, + metadata: Any = None, +) -> ModelField: + """ + Returns a schema for a model field, e.g.: + + ```py + from pydantic_core import core_schema + + field = core_schema.model_field(schema=core_schema.int_schema()) + ``` + + Args: + schema: The schema to use for the field + validation_alias: The alias(es) to use to find the field in the validation data + serialization_alias: The alias to use as a key when serializing + serialization_exclude: Whether to exclude the field when serializing + frozen: Whether the field is frozen + metadata: Any other information you want to include with the schema, not used by pydantic-core + """ + return _dict_not_none( + type='model-field', + schema=schema, + validation_alias=validation_alias, + serialization_alias=serialization_alias, + serialization_exclude=serialization_exclude, + frozen=frozen, + metadata=metadata, + ) + + +class ModelFieldsSchema(TypedDict, total=False): + type: Required[Literal['model-fields']] + fields: Required[Dict[str, ModelField]] + model_name: str + computed_fields: List[ComputedField] + strict: bool + extras_schema: CoreSchema + # all these values can be set via config, equivalent fields have `typed_dict_` prefix + extra_behavior: ExtraBehavior + populate_by_name: bool # replaces `allow_population_by_field_name` in pydantic v1 + from_attributes: bool + ref: str + metadata: Any + serialization: SerSchema + + +def model_fields_schema( + fields: Dict[str, ModelField], + *, + model_name: str | None = None, + computed_fields: list[ComputedField] | None = None, + strict: bool | None = None, + extras_schema: CoreSchema | None = None, + extra_behavior: ExtraBehavior | None = None, + populate_by_name: bool | None = None, + from_attributes: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> ModelFieldsSchema: + """ + Returns a schema that matches a typed dict, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + wrapper_schema = core_schema.model_fields_schema( + {'a': core_schema.model_field(core_schema.str_schema())} + ) + v = SchemaValidator(wrapper_schema) + print(v.validate_python({'a': 'hello'})) + #> ({'a': 'hello'}, None, {'a'}) + ``` + + Args: + fields: The fields to use for the typed dict + model_name: The name of the model, used for error messages, defaults to "Model" + computed_fields: Computed fields to use when serializing the model, only applies when directly inside a model + strict: Whether the typed dict is strict + extras_schema: The extra validator to use for the typed dict + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + extra_behavior: The extra behavior to use for the typed dict + populate_by_name: Whether the typed dict should populate by name + from_attributes: Whether the typed dict should be populated from attributes + serialization: Custom serialization schema + """ + return _dict_not_none( + type='model-fields', + fields=fields, + model_name=model_name, + computed_fields=computed_fields, + strict=strict, + extras_schema=extras_schema, + extra_behavior=extra_behavior, + populate_by_name=populate_by_name, + from_attributes=from_attributes, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class ModelSchema(TypedDict, total=False): + type: Required[Literal['model']] + cls: Required[Type[Any]] + schema: Required[CoreSchema] + custom_init: bool + root_model: bool + post_init: str + revalidate_instances: Literal['always', 'never', 'subclass-instances'] # default: 'never' + strict: bool + frozen: bool + extra_behavior: ExtraBehavior + config: CoreConfig + ref: str + metadata: Any + serialization: SerSchema + + +def model_schema( + cls: Type[Any], + schema: CoreSchema, + *, + custom_init: bool | None = None, + root_model: bool | None = None, + post_init: str | None = None, + revalidate_instances: Literal['always', 'never', 'subclass-instances'] | None = None, + strict: bool | None = None, + frozen: bool | None = None, + extra_behavior: ExtraBehavior | None = None, + config: CoreConfig | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> ModelSchema: + """ + A model schema generally contains a typed-dict schema. + It will run the typed dict validator, then create a new class + and set the dict and fields set returned from the typed dict validator + to `__dict__` and `__pydantic_fields_set__` respectively. + + Example: + + ```py + from pydantic_core import CoreConfig, SchemaValidator, core_schema + + class MyModel: + __slots__ = ( + '__dict__', + '__pydantic_fields_set__', + '__pydantic_extra__', + '__pydantic_private__', + ) + + schema = core_schema.model_schema( + cls=MyModel, + config=CoreConfig(str_max_length=5), + schema=core_schema.model_fields_schema( + fields={'a': core_schema.model_field(core_schema.str_schema())}, + ), + ) + v = SchemaValidator(schema) + assert v.isinstance_python({'a': 'hello'}) is True + assert v.isinstance_python({'a': 'too long'}) is False + ``` + + Args: + cls: The class to use for the model + schema: The schema to use for the model + custom_init: Whether the model has a custom init method + root_model: Whether the model is a `RootModel` + post_init: The call after init to use for the model + revalidate_instances: whether instances of models and dataclasses (including subclass instances) + should re-validate defaults to config.revalidate_instances, else 'never' + strict: Whether the model is strict + frozen: Whether the model is frozen + extra_behavior: The extra behavior to use for the model, used in serialization + config: The config to use for the model + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='model', + cls=cls, + schema=schema, + custom_init=custom_init, + root_model=root_model, + post_init=post_init, + revalidate_instances=revalidate_instances, + strict=strict, + frozen=frozen, + extra_behavior=extra_behavior, + config=config, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class DataclassField(TypedDict, total=False): + type: Required[Literal['dataclass-field']] + name: Required[str] + schema: Required[CoreSchema] + kw_only: bool # default: True + init: bool # default: True + init_only: bool # default: False + frozen: bool # default: False + validation_alias: Union[str, List[Union[str, int]], List[List[Union[str, int]]]] + serialization_alias: str + serialization_exclude: bool # default: False + metadata: Any + + +def dataclass_field( + name: str, + schema: CoreSchema, + *, + kw_only: bool | None = None, + init: bool | None = None, + init_only: bool | None = None, + validation_alias: str | list[str | int] | list[list[str | int]] | None = None, + serialization_alias: str | None = None, + serialization_exclude: bool | None = None, + metadata: Any = None, + frozen: bool | None = None, +) -> DataclassField: + """ + Returns a schema for a dataclass field, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + field = core_schema.dataclass_field( + name='a', schema=core_schema.str_schema(), kw_only=False + ) + schema = core_schema.dataclass_args_schema('Foobar', [field]) + v = SchemaValidator(schema) + assert v.validate_python({'a': 'hello'}) == ({'a': 'hello'}, None) + ``` + + Args: + name: The name to use for the argument parameter + schema: The schema to use for the argument parameter + kw_only: Whether the field can be set with a positional argument as well as a keyword argument + init: Whether the field should be validated during initialization + init_only: Whether the field should be omitted from `__dict__` and passed to `__post_init__` + validation_alias: The alias(es) to use to find the field in the validation data + serialization_alias: The alias to use as a key when serializing + serialization_exclude: Whether to exclude the field when serializing + metadata: Any other information you want to include with the schema, not used by pydantic-core + frozen: Whether the field is frozen + """ + return _dict_not_none( + type='dataclass-field', + name=name, + schema=schema, + kw_only=kw_only, + init=init, + init_only=init_only, + validation_alias=validation_alias, + serialization_alias=serialization_alias, + serialization_exclude=serialization_exclude, + metadata=metadata, + frozen=frozen, + ) + + +class DataclassArgsSchema(TypedDict, total=False): + type: Required[Literal['dataclass-args']] + dataclass_name: Required[str] + fields: Required[List[DataclassField]] + computed_fields: List[ComputedField] + populate_by_name: bool # default: False + collect_init_only: bool # default: False + ref: str + metadata: Any + serialization: SerSchema + extra_behavior: ExtraBehavior + + +def dataclass_args_schema( + dataclass_name: str, + fields: list[DataclassField], + *, + computed_fields: List[ComputedField] | None = None, + populate_by_name: bool | None = None, + collect_init_only: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, + extra_behavior: ExtraBehavior | None = None, +) -> DataclassArgsSchema: + """ + Returns a schema for validating dataclass arguments, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + field_a = core_schema.dataclass_field( + name='a', schema=core_schema.str_schema(), kw_only=False + ) + field_b = core_schema.dataclass_field( + name='b', schema=core_schema.bool_schema(), kw_only=False + ) + schema = core_schema.dataclass_args_schema('Foobar', [field_a, field_b]) + v = SchemaValidator(schema) + assert v.validate_python({'a': 'hello', 'b': True}) == ({'a': 'hello', 'b': True}, None) + ``` + + Args: + dataclass_name: The name of the dataclass being validated + fields: The fields to use for the dataclass + computed_fields: Computed fields to use when serializing the dataclass + populate_by_name: Whether to populate by name + collect_init_only: Whether to collect init only fields into a dict to pass to `__post_init__` + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + extra_behavior: How to handle extra fields + """ + return _dict_not_none( + type='dataclass-args', + dataclass_name=dataclass_name, + fields=fields, + computed_fields=computed_fields, + populate_by_name=populate_by_name, + collect_init_only=collect_init_only, + ref=ref, + metadata=metadata, + serialization=serialization, + extra_behavior=extra_behavior, + ) + + +class DataclassSchema(TypedDict, total=False): + type: Required[Literal['dataclass']] + cls: Required[Type[Any]] + schema: Required[CoreSchema] + fields: Required[List[str]] + cls_name: str + post_init: bool # default: False + revalidate_instances: Literal['always', 'never', 'subclass-instances'] # default: 'never' + strict: bool # default: False + frozen: bool # default False + ref: str + metadata: Any + serialization: SerSchema + slots: bool + config: CoreConfig + + +def dataclass_schema( + cls: Type[Any], + schema: CoreSchema, + fields: List[str], + *, + cls_name: str | None = None, + post_init: bool | None = None, + revalidate_instances: Literal['always', 'never', 'subclass-instances'] | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, + frozen: bool | None = None, + slots: bool | None = None, + config: CoreConfig | None = None, +) -> DataclassSchema: + """ + Returns a schema for a dataclass. As with `ModelSchema`, this schema can only be used as a field within + another schema, not as the root type. + + Args: + cls: The dataclass type, used to perform subclass checks + schema: The schema to use for the dataclass fields + fields: Fields of the dataclass, this is used in serialization and in validation during re-validation + and while validating assignment + cls_name: The name to use in error locs, etc; this is useful for generics (default: `cls.__name__`) + post_init: Whether to call `__post_init__` after validation + revalidate_instances: whether instances of models and dataclasses (including subclass instances) + should re-validate defaults to config.revalidate_instances, else 'never' + strict: Whether to require an exact instance of `cls` + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + frozen: Whether the dataclass is frozen + slots: Whether `slots=True` on the dataclass, means each field is assigned independently, rather than + simply setting `__dict__`, default false + """ + return _dict_not_none( + type='dataclass', + cls=cls, + fields=fields, + cls_name=cls_name, + schema=schema, + post_init=post_init, + revalidate_instances=revalidate_instances, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + frozen=frozen, + slots=slots, + config=config, + ) + + +class ArgumentsParameter(TypedDict, total=False): + name: Required[str] + schema: Required[CoreSchema] + mode: Literal['positional_only', 'positional_or_keyword', 'keyword_only'] # default positional_or_keyword + alias: Union[str, List[Union[str, int]], List[List[Union[str, int]]]] + + +def arguments_parameter( + name: str, + schema: CoreSchema, + *, + mode: Literal['positional_only', 'positional_or_keyword', 'keyword_only'] | None = None, + alias: str | list[str | int] | list[list[str | int]] | None = None, +) -> ArgumentsParameter: + """ + Returns a schema that matches an argument parameter, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + param = core_schema.arguments_parameter( + name='a', schema=core_schema.str_schema(), mode='positional_only' + ) + schema = core_schema.arguments_schema([param]) + v = SchemaValidator(schema) + assert v.validate_python(('hello',)) == (('hello',), {}) + ``` + + Args: + name: The name to use for the argument parameter + schema: The schema to use for the argument parameter + mode: The mode to use for the argument parameter + alias: The alias to use for the argument parameter + """ + return _dict_not_none(name=name, schema=schema, mode=mode, alias=alias) + + +class ArgumentsSchema(TypedDict, total=False): + type: Required[Literal['arguments']] + arguments_schema: Required[List[ArgumentsParameter]] + populate_by_name: bool + var_args_schema: CoreSchema + var_kwargs_schema: CoreSchema + ref: str + metadata: Any + serialization: SerSchema + + +def arguments_schema( + arguments: list[ArgumentsParameter], + *, + populate_by_name: bool | None = None, + var_args_schema: CoreSchema | None = None, + var_kwargs_schema: CoreSchema | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> ArgumentsSchema: + """ + Returns a schema that matches an arguments schema, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + param_a = core_schema.arguments_parameter( + name='a', schema=core_schema.str_schema(), mode='positional_only' + ) + param_b = core_schema.arguments_parameter( + name='b', schema=core_schema.bool_schema(), mode='positional_only' + ) + schema = core_schema.arguments_schema([param_a, param_b]) + v = SchemaValidator(schema) + assert v.validate_python(('hello', True)) == (('hello', True), {}) + ``` + + Args: + arguments: The arguments to use for the arguments schema + populate_by_name: Whether to populate by name + var_args_schema: The variable args schema to use for the arguments schema + var_kwargs_schema: The variable kwargs schema to use for the arguments schema + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='arguments', + arguments_schema=arguments, + populate_by_name=populate_by_name, + var_args_schema=var_args_schema, + var_kwargs_schema=var_kwargs_schema, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class CallSchema(TypedDict, total=False): + type: Required[Literal['call']] + arguments_schema: Required[CoreSchema] + function: Required[Callable[..., Any]] + function_name: str # default function.__name__ + return_schema: CoreSchema + ref: str + metadata: Any + serialization: SerSchema + + +def call_schema( + arguments: CoreSchema, + function: Callable[..., Any], + *, + function_name: str | None = None, + return_schema: CoreSchema | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> CallSchema: + """ + Returns a schema that matches an arguments schema, then calls a function, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + param_a = core_schema.arguments_parameter( + name='a', schema=core_schema.str_schema(), mode='positional_only' + ) + param_b = core_schema.arguments_parameter( + name='b', schema=core_schema.bool_schema(), mode='positional_only' + ) + args_schema = core_schema.arguments_schema([param_a, param_b]) + + schema = core_schema.call_schema( + arguments=args_schema, + function=lambda a, b: a + str(not b), + return_schema=core_schema.str_schema(), + ) + v = SchemaValidator(schema) + assert v.validate_python((('hello', True))) == 'helloFalse' + ``` + + Args: + arguments: The arguments to use for the arguments schema + function: The function to use for the call schema + function_name: The function name to use for the call schema, if not provided `function.__name__` is used + return_schema: The return schema to use for the call schema + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='call', + arguments_schema=arguments, + function=function, + function_name=function_name, + return_schema=return_schema, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class CustomErrorSchema(TypedDict, total=False): + type: Required[Literal['custom-error']] + schema: Required[CoreSchema] + custom_error_type: Required[str] + custom_error_message: str + custom_error_context: Dict[str, Union[str, int, float]] + ref: str + metadata: Any + serialization: SerSchema + + +def custom_error_schema( + schema: CoreSchema, + custom_error_type: str, + *, + custom_error_message: str | None = None, + custom_error_context: dict[str, Any] | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> CustomErrorSchema: + """ + Returns a schema that matches a custom error value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.custom_error_schema( + schema=core_schema.int_schema(), + custom_error_type='MyError', + custom_error_message='Error msg', + ) + v = SchemaValidator(schema) + v.validate_python(1) + ``` + + Args: + schema: The schema to use for the custom error schema + custom_error_type: The custom error type to use for the custom error schema + custom_error_message: The custom error message to use for the custom error schema + custom_error_context: The custom error context to use for the custom error schema + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='custom-error', + schema=schema, + custom_error_type=custom_error_type, + custom_error_message=custom_error_message, + custom_error_context=custom_error_context, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class JsonSchema(TypedDict, total=False): + type: Required[Literal['json']] + schema: CoreSchema + ref: str + metadata: Any + serialization: SerSchema + + +def json_schema( + schema: CoreSchema | None = None, + *, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> JsonSchema: + """ + Returns a schema that matches a JSON value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + dict_schema = core_schema.model_fields_schema( + { + 'field_a': core_schema.model_field(core_schema.str_schema()), + 'field_b': core_schema.model_field(core_schema.bool_schema()), + }, + ) + + class MyModel: + __slots__ = ( + '__dict__', + '__pydantic_fields_set__', + '__pydantic_extra__', + '__pydantic_private__', + ) + field_a: str + field_b: bool + + json_schema = core_schema.json_schema(schema=dict_schema) + schema = core_schema.model_schema(cls=MyModel, schema=json_schema) + v = SchemaValidator(schema) + m = v.validate_python('{"field_a": "hello", "field_b": true}') + assert isinstance(m, MyModel) + ``` + + Args: + schema: The schema to use for the JSON schema + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none(type='json', schema=schema, ref=ref, metadata=metadata, serialization=serialization) + + +class UrlSchema(TypedDict, total=False): + type: Required[Literal['url']] + max_length: int + allowed_schemes: List[str] + host_required: bool # default False + default_host: str + default_port: int + default_path: str + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def url_schema( + *, + max_length: int | None = None, + allowed_schemes: list[str] | None = None, + host_required: bool | None = None, + default_host: str | None = None, + default_port: int | None = None, + default_path: str | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> UrlSchema: + """ + Returns a schema that matches a URL value, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.url_schema() + v = SchemaValidator(schema) + print(v.validate_python('https://example.com')) + #> https://example.com/ + ``` + + Args: + max_length: The maximum length of the URL + allowed_schemes: The allowed URL schemes + host_required: Whether the URL must have a host + default_host: The default host to use if the URL does not have a host + default_port: The default port to use if the URL does not have a port + default_path: The default path to use if the URL does not have a path + strict: Whether to use strict URL parsing + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='url', + max_length=max_length, + allowed_schemes=allowed_schemes, + host_required=host_required, + default_host=default_host, + default_port=default_port, + default_path=default_path, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class MultiHostUrlSchema(TypedDict, total=False): + type: Required[Literal['multi-host-url']] + max_length: int + allowed_schemes: List[str] + host_required: bool # default False + default_host: str + default_port: int + default_path: str + strict: bool + ref: str + metadata: Any + serialization: SerSchema + + +def multi_host_url_schema( + *, + max_length: int | None = None, + allowed_schemes: list[str] | None = None, + host_required: bool | None = None, + default_host: str | None = None, + default_port: int | None = None, + default_path: str | None = None, + strict: bool | None = None, + ref: str | None = None, + metadata: Any = None, + serialization: SerSchema | None = None, +) -> MultiHostUrlSchema: + """ + Returns a schema that matches a URL value with possibly multiple hosts, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.multi_host_url_schema() + v = SchemaValidator(schema) + print(v.validate_python('redis://localhost,0.0.0.0,127.0.0.1')) + #> redis://localhost,0.0.0.0,127.0.0.1 + ``` + + Args: + max_length: The maximum length of the URL + allowed_schemes: The allowed URL schemes + host_required: Whether the URL must have a host + default_host: The default host to use if the URL does not have a host + default_port: The default port to use if the URL does not have a port + default_path: The default path to use if the URL does not have a path + strict: Whether to use strict URL parsing + ref: optional unique identifier of the schema, used to reference the schema in other places + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='multi-host-url', + max_length=max_length, + allowed_schemes=allowed_schemes, + host_required=host_required, + default_host=default_host, + default_port=default_port, + default_path=default_path, + strict=strict, + ref=ref, + metadata=metadata, + serialization=serialization, + ) + + +class DefinitionsSchema(TypedDict, total=False): + type: Required[Literal['definitions']] + schema: Required[CoreSchema] + definitions: Required[List[CoreSchema]] + metadata: Any + serialization: SerSchema + + +def definitions_schema(schema: CoreSchema, definitions: list[CoreSchema]) -> DefinitionsSchema: + """ + Build a schema that contains both an inner schema and a list of definitions which can be used + within the inner schema. + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema = core_schema.definitions_schema( + core_schema.list_schema(core_schema.definition_reference_schema('foobar')), + [core_schema.int_schema(ref='foobar')], + ) + v = SchemaValidator(schema) + assert v.validate_python([1, 2, '3']) == [1, 2, 3] + ``` + + Args: + schema: The inner schema + definitions: List of definitions which can be referenced within inner schema + """ + return DefinitionsSchema(type='definitions', schema=schema, definitions=definitions) + + +class DefinitionReferenceSchema(TypedDict, total=False): + type: Required[Literal['definition-ref']] + schema_ref: Required[str] + ref: str + metadata: Any + serialization: SerSchema + + +def definition_reference_schema( + schema_ref: str, ref: str | None = None, metadata: Any = None, serialization: SerSchema | None = None +) -> DefinitionReferenceSchema: + """ + Returns a schema that points to a schema stored in "definitions", this is useful for nested recursive + models and also when you want to define validators separately from the main schema, e.g.: + + ```py + from pydantic_core import SchemaValidator, core_schema + + schema_definition = core_schema.definition_reference_schema('list-schema') + schema = core_schema.definitions_schema( + schema=schema_definition, + definitions=[ + core_schema.list_schema(items_schema=schema_definition, ref='list-schema'), + ], + ) + v = SchemaValidator(schema) + assert v.validate_python([()]) == [[]] + ``` + + Args: + schema_ref: The schema ref to use for the definition reference schema + metadata: Any other information you want to include with the schema, not used by pydantic-core + serialization: Custom serialization schema + """ + return _dict_not_none( + type='definition-ref', schema_ref=schema_ref, ref=ref, metadata=metadata, serialization=serialization + ) + + +MYPY = False +# See https://github.com/python/mypy/issues/14034 for details, in summary mypy is extremely slow to process this +# union which kills performance not just for pydantic, but even for code using pydantic +if not MYPY: + CoreSchema = Union[ + AnySchema, + NoneSchema, + BoolSchema, + IntSchema, + FloatSchema, + DecimalSchema, + StringSchema, + BytesSchema, + DateSchema, + TimeSchema, + DatetimeSchema, + TimedeltaSchema, + LiteralSchema, + EnumSchema, + IsInstanceSchema, + IsSubclassSchema, + CallableSchema, + ListSchema, + TupleSchema, + SetSchema, + FrozenSetSchema, + GeneratorSchema, + DictSchema, + AfterValidatorFunctionSchema, + BeforeValidatorFunctionSchema, + WrapValidatorFunctionSchema, + PlainValidatorFunctionSchema, + WithDefaultSchema, + NullableSchema, + UnionSchema, + TaggedUnionSchema, + ChainSchema, + LaxOrStrictSchema, + JsonOrPythonSchema, + TypedDictSchema, + ModelFieldsSchema, + ModelSchema, + DataclassArgsSchema, + DataclassSchema, + ArgumentsSchema, + CallSchema, + CustomErrorSchema, + JsonSchema, + UrlSchema, + MultiHostUrlSchema, + DefinitionsSchema, + DefinitionReferenceSchema, + UuidSchema, + ] +elif False: + CoreSchema: TypeAlias = Mapping[str, Any] + + +# to update this, call `pytest -k test_core_schema_type_literal` and copy the output +CoreSchemaType = Literal[ + 'any', + 'none', + 'bool', + 'int', + 'float', + 'decimal', + 'str', + 'bytes', + 'date', + 'time', + 'datetime', + 'timedelta', + 'literal', + 'enum', + 'is-instance', + 'is-subclass', + 'callable', + 'list', + 'tuple', + 'set', + 'frozenset', + 'generator', + 'dict', + 'function-after', + 'function-before', + 'function-wrap', + 'function-plain', + 'default', + 'nullable', + 'union', + 'tagged-union', + 'chain', + 'lax-or-strict', + 'json-or-python', + 'typed-dict', + 'model-fields', + 'model', + 'dataclass-args', + 'dataclass', + 'arguments', + 'call', + 'custom-error', + 'json', + 'url', + 'multi-host-url', + 'definitions', + 'definition-ref', + 'uuid', +] + +CoreSchemaFieldType = Literal['model-field', 'dataclass-field', 'typed-dict-field', 'computed-field'] + + +# used in _pydantic_core.pyi::PydanticKnownError +# to update this, call `pytest -k test_all_errors` and copy the output +ErrorType = Literal[ + 'no_such_attribute', + 'json_invalid', + 'json_type', + 'recursion_loop', + 'missing', + 'frozen_field', + 'frozen_instance', + 'extra_forbidden', + 'invalid_key', + 'get_attribute_error', + 'model_type', + 'model_attributes_type', + 'dataclass_type', + 'dataclass_exact_type', + 'none_required', + 'greater_than', + 'greater_than_equal', + 'less_than', + 'less_than_equal', + 'multiple_of', + 'finite_number', + 'too_short', + 'too_long', + 'iterable_type', + 'iteration_error', + 'string_type', + 'string_sub_type', + 'string_unicode', + 'string_too_short', + 'string_too_long', + 'string_pattern_mismatch', + 'enum', + 'dict_type', + 'mapping_type', + 'list_type', + 'tuple_type', + 'set_type', + 'bool_type', + 'bool_parsing', + 'int_type', + 'int_parsing', + 'int_parsing_size', + 'int_from_float', + 'float_type', + 'float_parsing', + 'bytes_type', + 'bytes_too_short', + 'bytes_too_long', + 'value_error', + 'assertion_error', + 'literal_error', + 'date_type', + 'date_parsing', + 'date_from_datetime_parsing', + 'date_from_datetime_inexact', + 'date_past', + 'date_future', + 'time_type', + 'time_parsing', + 'datetime_type', + 'datetime_parsing', + 'datetime_object_invalid', + 'datetime_from_date_parsing', + 'datetime_past', + 'datetime_future', + 'timezone_naive', + 'timezone_aware', + 'timezone_offset', + 'time_delta_type', + 'time_delta_parsing', + 'frozen_set_type', + 'is_instance_of', + 'is_subclass_of', + 'callable_type', + 'union_tag_invalid', + 'union_tag_not_found', + 'arguments_type', + 'missing_argument', + 'unexpected_keyword_argument', + 'missing_keyword_only_argument', + 'unexpected_positional_argument', + 'missing_positional_only_argument', + 'multiple_argument_values', + 'url_type', + 'url_parsing', + 'url_syntax_violation', + 'url_too_long', + 'url_scheme', + 'uuid_type', + 'uuid_parsing', + 'uuid_version', + 'decimal_type', + 'decimal_parsing', + 'decimal_max_digits', + 'decimal_max_places', + 'decimal_whole_digits', +] + + +def _dict_not_none(**kwargs: Any) -> Any: + return {k: v for k, v in kwargs.items() if v is not None} + + +############################################################################### +# All this stuff is deprecated by #980 and will be removed eventually +# They're kept because some code external code will be using them + + +@deprecated('`field_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.') +def field_before_validator_function(function: WithInfoValidatorFunction, field_name: str, schema: CoreSchema, **kwargs): + warnings.warn( + '`field_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.', + DeprecationWarning, + ) + return with_info_before_validator_function(function, schema, field_name=field_name, **kwargs) + + +@deprecated('`general_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.') +def general_before_validator_function(*args, **kwargs): + warnings.warn( + '`general_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.', + DeprecationWarning, + ) + return with_info_before_validator_function(*args, **kwargs) + + +@deprecated('`field_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.') +def field_after_validator_function(function: WithInfoValidatorFunction, field_name: str, schema: CoreSchema, **kwargs): + warnings.warn( + '`field_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.', + DeprecationWarning, + ) + return with_info_after_validator_function(function, schema, field_name=field_name, **kwargs) + + +@deprecated('`general_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.') +def general_after_validator_function(*args, **kwargs): + warnings.warn( + '`general_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.', + DeprecationWarning, + ) + return with_info_after_validator_function(*args, **kwargs) + + +@deprecated('`field_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.') +def field_wrap_validator_function( + function: WithInfoWrapValidatorFunction, field_name: str, schema: CoreSchema, **kwargs +): + warnings.warn( + '`field_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.', + DeprecationWarning, + ) + return with_info_wrap_validator_function(function, schema, field_name=field_name, **kwargs) + + +@deprecated('`general_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.') +def general_wrap_validator_function(*args, **kwargs): + warnings.warn( + '`general_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.', + DeprecationWarning, + ) + return with_info_wrap_validator_function(*args, **kwargs) + + +@deprecated('`field_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.') +def field_plain_validator_function(function: WithInfoValidatorFunction, field_name: str, **kwargs): + warnings.warn( + '`field_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.', + DeprecationWarning, + ) + return with_info_plain_validator_function(function, field_name=field_name, **kwargs) + + +@deprecated('`general_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.') +def general_plain_validator_function(*args, **kwargs): + warnings.warn( + '`general_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.', + DeprecationWarning, + ) + return with_info_plain_validator_function(*args, **kwargs) + + +_deprecated_import_lookup = { + 'FieldValidationInfo': ValidationInfo, + 'FieldValidatorFunction': WithInfoValidatorFunction, + 'GeneralValidatorFunction': WithInfoValidatorFunction, + 'FieldWrapValidatorFunction': WithInfoWrapValidatorFunction, +} + +if TYPE_CHECKING: + FieldValidationInfo = ValidationInfo + + +def __getattr__(attr_name: str) -> object: + new_attr = _deprecated_import_lookup.get(attr_name) + if new_attr is None: + raise AttributeError(f"module 'pydantic_core' has no attribute '{attr_name}'") + else: + import warnings + + msg = f'`{attr_name}` is deprecated, use `{new_attr.__name__}` instead.' + warnings.warn(msg, DeprecationWarning, stacklevel=1) + return new_attr diff --git a/venv/lib/python3.10/site-packages/pydantic_core/py.typed b/venv/lib/python3.10/site-packages/pydantic_core/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/lib/python3.10/site-packages/tqdm_multiprocess/__init__.py b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6559147bb25adffe08cca548cd0bccc19ed8c6f1 --- /dev/null +++ b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__init__.py @@ -0,0 +1 @@ +from .std import TqdmMultiProcessPool diff --git a/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/__init__.cpython-310.pyc b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cec476a36986ae9d411009d3dd575e2002e13f24 Binary files /dev/null and b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/__init__.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/logger.cpython-310.pyc b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/logger.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..676fa09505bf2a348721ad68bd5a743b780dcf1f Binary files /dev/null and b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/logger.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/std.cpython-310.pyc b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/std.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c911a84fd0786f8a6adae6744b3beac0aa016efd Binary files /dev/null and b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/std.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/tqdm_multiprocess.cpython-310.pyc b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/tqdm_multiprocess.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b5d21dac5977af617afc44a13b34796290cc601 Binary files /dev/null and b/venv/lib/python3.10/site-packages/tqdm_multiprocess/__pycache__/tqdm_multiprocess.cpython-310.pyc differ diff --git a/venv/lib/python3.10/site-packages/tqdm_multiprocess/logger.py b/venv/lib/python3.10/site-packages/tqdm_multiprocess/logger.py new file mode 100644 index 0000000000000000000000000000000000000000..f0cc75fc11cec63c6456cccfffb3acb2ad8e208c --- /dev/null +++ b/venv/lib/python3.10/site-packages/tqdm_multiprocess/logger.py @@ -0,0 +1,98 @@ +import logging +import time +from datetime import timedelta +from tqdm import tqdm + +class LogFormatter(): + + def __init__(self): + self.start_time = time.time() + + def format(self, record): + elapsed_seconds = round(record.created - self.start_time) + + prefix = "%s - %s - %s" % ( + record.levelname, + time.strftime('%x %X'), + timedelta(seconds=elapsed_seconds) + ) + message = record.getMessage() + message = message.replace('\n', '\n' + ' ' * (len(prefix) + 3)) + return "%s - %s" % (prefix, message) if message else '' + + def reset_time(self): + self.start_time = time.time() + +def setup_logger(filepath=None, to_console=True, formatter=LogFormatter()): + + # create logger + logger = logging.getLogger() + logger.setLevel(logging.DEBUG) + logger.propagate = False + + logger.handlers = [] + + # create file handler + if filepath is not None: + file_handler = logging.FileHandler(filepath, "a") + file_handler.setLevel(logging.DEBUG) + file_handler.setFormatter(formatter) + logger.addHandler(file_handler) + + # create console handler + if to_console: + console_handler = logging.StreamHandler() + console_handler.setLevel(logging.INFO) + console_handler.setFormatter(formatter) + logger.addHandler(console_handler) + +class ChildProcessHandler(logging.StreamHandler): + def __init__(self, message_queue): + self.message_queue = message_queue + logging.StreamHandler.__init__(self) + + def emit(self, record): + self.message_queue.put(record) + +def setup_logger_child_process(message_queue): + # create logger + logger = logging.getLogger() + logger.setLevel(logging.DEBUG) + logger.propagate = False + + logger.handlers = [] + + # create queue handler + child_process_handler = ChildProcessHandler(message_queue) + child_process_handler.setLevel(logging.INFO) + logger.addHandler(child_process_handler) + +class TqdmHandler(logging.StreamHandler): + def __init__(self): + logging.StreamHandler.__init__(self) + + def emit(self, record): + msg = self.format(record) + tqdm.write(msg) + +def setup_logger_tqdm(filepath=None, formatter=LogFormatter()): + + # create logger + logger = logging.getLogger() + logger.setLevel(logging.DEBUG) + logger.propagate = False + + logger.handlers = [] + + # create file handler + if filepath is not None: + file_handler = logging.FileHandler(filepath, "a") + file_handler.setLevel(logging.DEBUG) + file_handler.setFormatter(formatter) + logger.addHandler(file_handler) + + # create tqdm handler + tqdm_handler = TqdmHandler() + tqdm_handler.setLevel(logging.INFO) + tqdm_handler.setFormatter(formatter) + logger.addHandler(tqdm_handler) \ No newline at end of file diff --git a/venv/lib/python3.10/site-packages/tqdm_multiprocess/std.py b/venv/lib/python3.10/site-packages/tqdm_multiprocess/std.py new file mode 100644 index 0000000000000000000000000000000000000000..ef5dc3dfb87351aaf0931352203a42aec431e5f5 --- /dev/null +++ b/venv/lib/python3.10/site-packages/tqdm_multiprocess/std.py @@ -0,0 +1,196 @@ +import multiprocessing +import signal +from signal import SIGINT, SIG_IGN +from queue import Empty as EmptyQueue +import sys +import tqdm +from functools import partial + +import logging +from .logger import setup_logger_child_process +logger = logging.getLogger(__name__) + +class MultiProcessTqdm(object): + def __init__(self, message_queue, tqdm_id, *args, **kwargs): + self.message_queue = message_queue + self.tqdm_id = tqdm_id + message = (multiprocessing.current_process().name, "__init__", args, kwargs) + self.message_queue.put((self.tqdm_id, message)) + + def __enter__(self, *args, **kwargs): + message = (multiprocessing.current_process().name, "__enter__", args, kwargs) + self.message_queue.put((self.tqdm_id, message)) + return self + + def __exit__(self, *args, **kwargs): + message = (multiprocessing.current_process().name, "__exit__", args, kwargs) + self.message_queue.put((self.tqdm_id, message)) + + def __getattr__(self, method_name): + def _missing(*args, **kwargs): + message = (multiprocessing.current_process().name, method_name, args, kwargs) + self.message_queue.put((self.tqdm_id, message)) + return _missing + +class GlobalMultiProcessTqdm(MultiProcessTqdm): + # We don't want to init so no message is passed. Also the id is not applicable. + def __init__(self, message_queue): + self.message_queue = message_queue + self.tqdm_id = 0 + +def get_multi_tqdm(message_queue, tqdms_list, *args, **kwargs): + tqdm_id = len(tqdms_list) + # kwargs["mininterval"] = 1 # Slow it down + multi_tqdm = MultiProcessTqdm(message_queue, tqdm_id, *args, **kwargs) + tqdms_list.append(multi_tqdm) + return multi_tqdm + +terminate = False +def handler(signal_received, frame): + global terminate + terminate = True + +# Signal handling for multiprocess. The "correct" answer doesn't work on windows at all. +# Using the version with a very slight race condition. Don't ctrl-c in that miniscule time window... +# https://stackoverflow.com/questions/11312525/catch-ctrlc-sigint-and-exit-multiprocesses-gracefully-in-python +def init_worker(logging_queue): + setup_logger_child_process(logging_queue) + signal.signal(SIGINT, SIG_IGN) + +def task_wrapper(tqdm_queue, global_tqdm_queue, operation, *args): + tqdms_list = [] + tqdm_partial = partial(get_multi_tqdm, tqdm_queue, tqdms_list) + global_tqdm = GlobalMultiProcessTqdm(global_tqdm_queue) + return operation(*args, tqdm_partial, global_tqdm) + +class TqdmMultiProcessPool(object): + def __init__(self, process_count): + self.mp_manager = multiprocessing.Manager() + self.logging_queue = self.mp_manager.Queue() + self.tqdm_queue = self.mp_manager.Queue() + self.global_tqdm_queue = self.mp_manager.Queue() + self.process_count = process_count + worker_init_function = partial(init_worker, self.logging_queue) + self.mp_pool = multiprocessing.Pool(self.process_count, worker_init_function) + + def map(self, global_tqdm, tasks, on_error, on_done): + + self.previous_signal_int = signal.signal(SIGINT, handler) + + tqdms = {} # {} for _ in range(process_count)] + + async_results = [] + for operation, args in tasks: + wrapper_args = tuple([self.tqdm_queue, self.global_tqdm_queue, operation] + list(args)) + async_results.append(self.mp_pool.apply_async(task_wrapper, wrapper_args)) + + completion_status = [False for _ in async_results] + countdown = len(completion_status) + task_results = [None for _ in async_results] + while countdown > 0 and not terminate: + # Worker Logging + try: + logger_record = self.logging_queue.get_nowait() + getattr(logger, logger_record.levelname.lower())(logger_record.getMessage()) + except (EmptyQueue, InterruptedError): + pass + + # Worker tqdms + try: + count = 0 + while True: + tqdm_id, tqdm_message = self.tqdm_queue.get_nowait() + process_id, method_name, args, kwargs = tqdm_message + process_id = int(process_id[-1]) + if process_id not in tqdms: + tqdms[process_id] = {} + + if method_name == "__init__": + tqdms[process_id][tqdm_id] = tqdm.tqdm(*args, **kwargs) + else: + getattr(tqdms[process_id][tqdm_id], method_name)(*args, **kwargs) + + count += 1 + if count > 1000: + logger.info("Tqdm worker queue flood.") + except (EmptyQueue, InterruptedError): + pass + + # Global tqdm + try: + count = 0 + while True: + tqdm_id, tqdm_message = self.global_tqdm_queue.get_nowait() + process_id, method_name, args, kwargs = tqdm_message + getattr(global_tqdm, method_name)(*args, **kwargs) + + count += 1 + if count > 1000: + logger.info("Tqdm global queue flood.") + except (EmptyQueue, InterruptedError): + pass + + # Task Completion + for i, async_result in enumerate(async_results): + if completion_status[i]: + continue + if async_result.ready(): + task_result = async_result.get() + task_results[i] = task_result + completion_status[i] = True + countdown -= 1 + + # Task failed, do on_error + if not task_result: + on_error(task_result) + + on_done(task_result) + + if terminate: + logger.info('SIGINT or CTRL-C detected, closing pool. Please wait.') + self.mp_pool.close() + + # Clear out remaining message queues. Sometimes get_nowait returns garbage + # without erroring, just catching all exceptions as we don't care that much + # about logging messages. + try: + while True: + logger_record = self.logging_queue.get_nowait() + getattr(logger, logger_record.levelname.lower())(logger_record.getMessage()) + except (EmptyQueue, InterruptedError): + pass + except Exception: + pass + + try: + while True: + tqdm_id, tqdm_message = self.global_tqdm_queue.get_nowait() + process_id, method_name, args, kwargs = tqdm_message + getattr(global_tqdm, method_name)(*args, **kwargs) + except (EmptyQueue, InterruptedError): + pass + + try: + while True: + tqdm_record = self.tqdm_queue.get_nowait() + tqdm_id, tqdm_message = tqdm_record + process_id, method_name, args, kwargs = tqdm_message + process_id = int(process_id[-1]) + if method_name == "__init__": + tqdms[process_id][tqdm_id] = tqdm.tqdm(*args, **kwargs) + else: + getattr(tqdms[process_id][tqdm_id], method_name)(*args, **kwargs) + except (EmptyQueue, InterruptedError): + pass + + if terminate: + logger.info('Terminating.') + for key, process_tqdms in tqdms.items(): + for key, tqdm_instance in process_tqdms.items(): + if tqdm_instance: + tqdm_instance.close() + sys.exit(0) # Will trigger __exit__ + + signal.signal(SIGINT, self.previous_signal_int) + + return task_results \ No newline at end of file diff --git a/venv/lib/python3.10/site-packages/tqdm_multiprocess/tqdm_multiprocess.py b/venv/lib/python3.10/site-packages/tqdm_multiprocess/tqdm_multiprocess.py new file mode 100644 index 0000000000000000000000000000000000000000..8747e78edad47d9446f492ee7e6003a3ac8aab68 --- /dev/null +++ b/venv/lib/python3.10/site-packages/tqdm_multiprocess/tqdm_multiprocess.py @@ -0,0 +1,139 @@ +import multiprocessing +import signal +from signal import SIGINT, SIG_IGN +from queue import Empty as EmptyQueue +import sys +import tqdm +from functools import partial + +import logging +from tqdm_multiprocess.logger import setup_logger_child_process +logger = logging.getLogger(__name__) + +class MultiProcessTqdm(object): + def __init__(self, message_queue, tqdm_id, *args, **kwargs): + self.message_queue = message_queue + self.tqdm_id = tqdm_id + message = (multiprocessing.current_process().name, "__init__", args, kwargs) + self.message_queue.put((self.tqdm_id, message)) + + def __enter__(self, *args, **kwargs): + message = (multiprocessing.current_process().name, "__enter__", args, kwargs) + self.message_queue.put((self.tqdm_id, message)) + return self + + def __exit__(self, *args, **kwargs): + message = (multiprocessing.current_process().name, "__exit__", args, kwargs) + self.message_queue.put((self.tqdm_id, message)) + + def __getattr__(self, method_name): + def _missing(*args, **kwargs): + message = (multiprocessing.current_process().name, method_name, args, kwargs) + self.message_queue.put((self.tqdm_id, message)) + return _missing + +def get_multi_tqdm(message_queue, tqdms_list, *args, **kwargs): + tqdm_id = len(tqdms_list) + multi_tqdm = MultiProcessTqdm(message_queue, tqdm_id, *args, **kwargs) + tqdms_list.append(multi_tqdm) + return multi_tqdm + +terminate = False +def handler(signal_received, frame): + global terminate + terminate = True + +# Signal handling for multiprocess. The "correct" answer doesn't work on windows at all. +# Using the version with a very slight race condition. Don't ctrl-c in that miniscule time window... +# https://stackoverflow.com/questions/11312525/catch-ctrlc-sigint-and-exit-multiprocesses-gracefully-in-python +def init_worker(): + signal.signal(SIGINT, SIG_IGN) + +def task_wrapper(logging_queue, tqdm_queue, operation, *args): + tqdms_list = [] + setup_logger_child_process(logging_queue) + tqdm_partial = partial(get_multi_tqdm, tqdm_queue, tqdms_list) + return operation(*args, tqdm_partial) + +class TqdmMultiProcessPool(object): + def __init__(self): + pass + + def map(self, process_count, initial_tasks, on_error): + previous_signal_int = signal.signal(SIGINT, handler) + with multiprocessing.Pool(process_count, init_worker) as pool: + tqdms = [{} for _ in range(process_count)] + + m = multiprocessing.Manager() + logging_queue = m.Queue() + tqdm_queue = m.Queue() + + async_results = [] + for operation, args in initial_tasks: + wrapper_args = tuple([logging_queue, tqdm_queue, operation] + list(args)) + async_results.append(pool.apply_async(task_wrapper, wrapper_args)) + + completion_status = [False for _ in async_results] + countdown = len(completion_status) + task_results = [] + while countdown > 0 and not terminate: + try: + logger_record = logging_queue.get_nowait() + getattr(logger, logger_record.levelname.lower())(logger_record.getMessage()) + except (EmptyQueue, InterruptedError): + pass + + try: + tqdm_id, tqdm_message = tqdm_queue.get_nowait() + process_id, method_name, args, kwargs = tqdm_message + process_id = int(process_id[-1]) - 1 + if method_name == "__init__": + tqdms[process_id][tqdm_id] = tqdm.tqdm(*args, **kwargs) + else: + getattr(tqdms[process_id][tqdm_id], method_name)(*args, **kwargs) + except (EmptyQueue, InterruptedError): + pass + + for i, async_result in enumerate(async_results): + if completion_status[i]: + continue + if async_result.ready(): + task_result = async_result.get() + task_results.append(task_result) + completion_status[i] = True + countdown -= 1 + + # Task failed, do on_error + if not task_result: + on_error() + + # Clear out remaining message queue + try: + while True: + logger_record = logging_queue.get_nowait() + getattr(logger, logger_record.levelname.lower())(logger_record.getMessage()) + except (EmptyQueue, InterruptedError): + pass + + try: + while True: + tqdm_id, tqdm_message = tqdm_queue.get_nowait() + process_id, method_name, args, kwargs = tqdm_message + process_id = int(process_id[-1]) - 1 + if method_name == "__init__": + tqdms[process_id][tqdm_id] = tqdm.tqdm(*args, **kwargs) + else: + getattr(tqdms[process_id][tqdm_id], method_name)(*args, **kwargs) + except (EmptyQueue, InterruptedError): + pass + + if terminate: + for tqdm_instance in tqdms: + if tqdm_instance: + tqdm_instance.close() + logger.info('\nSIGINT or CTRL-C detected, killing pool') + sys.exit(0) + + signal.signal(SIGINT, previous_signal_int) + + return task_results \ No newline at end of file