Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typehints for model_loader and model_service_worker #2540

Merged
merged 5 commits into from
Aug 30, 2023

Conversation

ZachOBrien
Copy link
Contributor

Description

  1. Adds necessary typehinting and checks for None to make mypy happy in two files: ts/model_loader.py, ts/model_service_worker.py
  2. Adds unit test for None check in handle_connection

Related to #1512

Type of change

Code quality - typehints

Feature/Issue validation/testing

  • Added unit test for new None checking in handle_connection.
    See ts/tests/unit_tests/test_model_service_worker.py
  • Ran mypy on changed files
  • Ran sanity check (torchserve_sanity.py)
  • Ran regression tests (test/regression_tests.py)

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

@msaroufim msaroufim self-requested a review August 27, 2023 06:33
Copy link
Member

@msaroufim msaroufim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, let's see what ci says

@codecov
Copy link

codecov bot commented Aug 27, 2023

Codecov Report

Merging #2540 (4d43b5a) into master (fc814be) will increase coverage by 0.06%.
The diff coverage is 81.25%.

❗ Current head 4d43b5a differs from pull request most recent head 866bf0d. Consider uploading reports for the commit 866bf0d to get more accurate results

@@            Coverage Diff             @@
##           master    #2540      +/-   ##
==========================================
+ Coverage   72.64%   72.71%   +0.06%     
==========================================
  Files          79       79              
  Lines        3733     3742       +9     
  Branches       58       58              
==========================================
+ Hits         2712     2721       +9     
  Misses       1017     1017              
  Partials        4        4              
Files Changed Coverage Δ
ts/model_loader.py 88.31% <ø> (ø)
ts/model_service_worker.py 64.38% <66.66%> (+0.49%) ⬆️
ts/tests/unit_tests/test_model_service_worker.py 99.18% <100.00%> (+0.04%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@msaroufim msaroufim added the easy label Aug 29, 2023
@ZachOBrien
Copy link
Contributor Author

Hm, I haven't been able to replicate the ci regression test errors locally. It seems odd that in the first run only the GPU regression test failed, but after merging in master the GPU regression test passed but the CPU and macOS failed.

@msaroufim
Copy link
Member

Regressions I believe are unrelated to you so we can still merge this

@msaroufim msaroufim added this pull request to the merge queue Aug 30, 2023
Merged via the queue into pytorch:master with commit a37bb3c Aug 30, 2023
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants