]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
py : type-check all Python scripts with Pyright (#8341)
authorcompilade <redacted>
Sun, 7 Jul 2024 19:04:39 +0000 (15:04 -0400)
committerGitHub <redacted>
Sun, 7 Jul 2024 19:04:39 +0000 (15:04 -0400)
commit3fd62a6b1c9ca7b7c0093e984cc9c133c6f2726d
tree2ea1a1e2366027d62a25007b2ad8d7104fd83aab
parenta8db2a9ce64cd4417f6a312ab61858f17f0f8584
py : type-check all Python scripts with Pyright (#8341)

* py : type-check all Python scripts with Pyright

* server-tests : use trailing slash in openai base_url

* server-tests : add more type annotations

* server-tests : strip "chat" from base_url in oai_chat_completions

* server-tests : model metadata is a dict

* ci : disable pip cache in type-check workflow

The cache is not shared between branches, and it's 250MB in size,
so it would become quite a big part of the 10GB cache limit of the repo.

* py : fix new type errors from master branch

* tests : fix test-tokenizer-random.py

Apparently, gcc applies optimisations even when pre-processing,
which confuses pycparser.

* ci : only show warnings and errors in python type-check

The "information" level otherwise has entries
from 'examples/pydantic_models_to_grammar.py',
which could be confusing for someone trying to figure out what failed,
considering that these messages can safely be ignored
even though they look like errors.
33 files changed:
.devops/nix/package.nix
.github/workflows/python-type-check.yml [new file with mode: 0644]
convert_hf_to_gguf.py
convert_llama_ggml_to_gguf.py
examples/convert_legacy_llama.py
examples/finetune/convert_finetune_checkpoint_to_gguf.py
examples/json_schema_pydantic_example.py
examples/json_schema_to_grammar.py
examples/llava/convert_image_encoder_to_gguf.py
examples/llava/llava_surgery_v2.py
examples/pydantic_models_to_grammar.py
examples/pydantic_models_to_grammar_examples.py
examples/server/bench/bench.py
examples/server/tests/features/steps/steps.py
examples/server/tests/requirements.txt
examples/server_embd.py
examples/train-text-from-scratch/convert_train_checkpoint_to_gguf.py
ggml/ggml_vk_generate_shaders.py
gguf-py/gguf/gguf_reader.py
gguf-py/gguf/lazy.py
gguf-py/scripts/__init__.py
gguf-py/scripts/gguf_hash.py
gguf-py/scripts/gguf_new_metadata.py
gguf-py/tests/test_gguf.py
pyrightconfig.json
requirements/requirements-all.txt [new file with mode: 0644]
requirements/requirements-compare-llama-bench.txt [new file with mode: 0644]
requirements/requirements-pydantic.txt [new file with mode: 0644]
requirements/requirements-test-tokenizer-random.txt [new file with mode: 0644]
scripts/check-requirements.sh
scripts/compare-llama-bench.py
scripts/gen-unicode-data.py
tests/test-tokenizer-random.py