mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-12 04:00:42 +00:00
fix(mypy): resolve typing issues in post-training providers and model files
This commit achieves zero mypy errors across all 430 source files by addressing type issues in post-training providers, model implementations, and testing infrastructure. Key changes: - Created HFAutoModel Protocol for HuggingFace models to provide type safety without requiring complete type stubs - Added module overrides in pyproject.toml for libraries lacking type stubs (torchtune, fairscale, torchvision, datasets, etc.) - Fixed type issues in databricks provider and api_recorder Using centralized mypy.overrides instead of scattered inline suppressions provides cleaner code organization.
This commit is contained in:
parent
4d58147522
commit
01d1a2ffe9
10 changed files with 65 additions and 25 deletions
|
|
@ -347,7 +347,17 @@ exclude = [
|
|||
|
||||
[[tool.mypy.overrides]]
|
||||
# packages that lack typing annotations, do not have stubs, or are unavailable.
|
||||
module = ["yaml", "fire"]
|
||||
module = [
|
||||
"yaml",
|
||||
"fire",
|
||||
"torchtune.*",
|
||||
"fairscale.*",
|
||||
"torchvision.*",
|
||||
"datasets",
|
||||
"nest_asyncio",
|
||||
"streamlit_option_menu",
|
||||
"lmformatenforcer.*",
|
||||
]
|
||||
ignore_missing_imports = true
|
||||
|
||||
[tool.pydantic-mypy]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue