Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Add output argument to Trainer.predict and remove DataPipelineState #1157

Merged
merged 42 commits into from
Feb 14, 2022

Conversation

ethanwharris
Copy link
Collaborator

@ethanwharris ethanwharris commented Feb 7, 2022

What does this PR do?

  • Adds output argument to Trainer.predict
  • Adds collate_fn and input_transform properties to the DatasetProcessor base class
  • Removes ProcessState (refacors text data to apply tokenization in the collate function instead)
  • Removes DataPipelineState
  • Trims DataPipeline

With the state gone, there is now no more magic happening in the background. This means that properties such as labels and parameters are required to be passed to the task by the user.

Fixes #920

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@ethanwharris ethanwharris changed the title Add output argument to Trainer.predict and remove DataPipelineState [PoC] Add output argument to Trainer.predict and remove DataPipelineState Feb 9, 2022
@codecov
Copy link

codecov bot commented Feb 9, 2022

Codecov Report

Merging #1157 (055cf7d) into master (defbace) will decrease coverage by 0.29%.
The diff coverage is 94.73%.

❗ Current head 055cf7d differs from pull request most recent head 71773c7. Consider uploading reports for the commit 71773c7 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1157      +/-   ##
==========================================
- Coverage   89.26%   88.96%   -0.30%     
==========================================
  Files         286      285       -1     
  Lines       13045    12745     -300     
==========================================
- Hits        11644    11339     -305     
- Misses       1401     1406       +5     
Flag Coverage Δ
unittests 88.96% <94.73%> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/audio/classification/cli.py 100.00% <ø> (ø)
flash/audio/speech_recognition/data.py 100.00% <ø> (ø)
flash/core/data/process.py 64.00% <ø> (+1.93%) ⬆️
flash/core/data/splits.py 96.66% <ø> (-0.48%) ⬇️
flash/core/integrations/icevision/data.py 95.55% <ø> (-0.19%) ⬇️
flash/core/regression.py 86.36% <ø> (-0.60%) ⬇️
flash/core/utilities/stages.py 70.00% <ø> (-3.92%) ⬇️
flash/graph/classification/cli.py 92.30% <ø> (ø)
flash/image/classification/adapters.py 82.62% <ø> (ø)
flash/image/classification/cli.py 84.61% <ø> (ø)
... and 99 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update defbace...71773c7. Read the comment docs.

@ethanwharris ethanwharris added this to the v0.7 milestone Feb 9, 2022
@ethanwharris ethanwharris changed the title [PoC] Add output argument to Trainer.predict and remove DataPipelineState Add output argument to Trainer.predict and remove DataPipelineState Feb 9, 2022
@mergify mergify bot added the has conflicts label Feb 9, 2022
@mergify mergify bot removed the has conflicts label Feb 14, 2022
@ethanwharris ethanwharris merged commit 796c9c8 into master Feb 14, 2022
@ethanwharris ethanwharris deleted the feature/predict_output branch February 14, 2022 14:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for passing the output to use to the predict method
1 participant