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

build: Remove dill dependency #4985

Merged
merged 3 commits into from
May 26, 2023
Merged

build: Remove dill dependency #4985

merged 3 commits into from
May 26, 2023

Conversation

julian-risch
Copy link
Member

@julian-risch julian-risch commented May 23, 2023

Related Issues

Proposed Changes:

Remove dill dependency and remove dill from from saving models via torch.save with pickle_module set to dill.

How did you test it?

Notes for the reviewer

dill was introduced in FARM in deepset-ai/FARM#271 At that time we used torch.save to not only store the state dicts but also the model itself. As the AdaptiveModel allows defining a loss function as a callable, it was not serializable out of the box and we introduced dill to save it.
In Haystack, we're not storing the model class though and thus I believe dill is not necessary anymore. What remains to be checked is whether model saved with dill can be loaded without. If it's compatible, we can remove dill otherwise we need to keep it.

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added tests that demonstrate the correct behavior of the change
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test:.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@julian-risch julian-risch requested a review from a team as a code owner May 23, 2023 07:53
@julian-risch julian-risch requested review from bogdankostic and removed request for a team May 23, 2023 07:53
@julian-risch julian-risch marked this pull request as draft May 23, 2023 07:54
@coveralls
Copy link
Collaborator

coveralls commented May 23, 2023

Pull Request Test Coverage Report for Build 5091342081

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 470 unchanged lines in 12 files lost coverage.
  • Overall coverage increased (+0.09%) to 39.619%

Files with Coverage Reduction New Missed Lines %
nodes/file_converter/init.py 1 93.33%
agents/base.py 2 91.25%
init.py 2 83.33%
utils/openai_utils.py 13 75.64%
nodes/answer_generator/openai.py 17 72.22%
nodes/prompt/prompt_template.py 17 90.06%
nodes/retriever/_openai_encoder.py 26 30.68%
nodes/prompt/invocation_layer/open_ai.py 29 30.26%
utils/doc_store.py 30 27.59%
nodes/prompt/prompt_node.py 53 59.34%
Totals Coverage Status
Change from base Build 5055409480: 0.09%
Covered Lines: 8875
Relevant Lines: 22401

💛 - Coveralls

@julian-risch julian-risch self-assigned this May 23, 2023
@julian-risch julian-risch marked this pull request as ready for review May 26, 2023 13:23
Copy link
Contributor

@bogdankostic bogdankostic left a comment

Choose a reason for hiding this comment

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

LGTM

@julian-risch julian-risch merged commit 2ede4d1 into main May 26, 2023
@julian-risch julian-risch deleted the remove-dill branch May 26, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants