Skip to content

Conversation

@ashwinb
Copy link
Contributor

@ashwinb ashwinb commented Oct 28, 2025

Fixes mypy errors in post-training providers and llama model files. Main changes:

  • Created HFAutoModel Protocol for type-safe HuggingFace model handling
  • Added mypy.overrides for untyped libraries (torchtune, fairscale, etc)
  • Fixed databricks and api_recorder type issues

Note: ~1,200 errors remain in excluded files (see pyproject.toml exclude list).

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 28, 2025
@ashwinb ashwinb force-pushed the phase-2h-fix-remaining-errors branch 2 times, most recently from f5011a6 to 554e4b6 Compare October 28, 2025 12:39
@ashwinb ashwinb changed the title fix(mypy): resolve all remaining type errors - achieve zero mypy errors fix(mypy): resolve typing issues in post-training and model files Oct 28, 2025
… 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.
@ashwinb ashwinb force-pushed the phase-2h-fix-remaining-errors branch from 554e4b6 to 82510a2 Compare October 28, 2025 12:55
@ashwinb
Copy link
Contributor Author

ashwinb commented Oct 28, 2025

Merged into PR #3938 to combine related changes.

@ashwinb ashwinb closed this Oct 28, 2025
@ashwinb ashwinb deleted the phase-2h-fix-remaining-errors branch October 28, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants