Deserialization from notebook #30
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, this is a follow up to my previous pull request.
The new code allows the user to pick up from a conversation saved into a notebook, or from any notebook even if it wasn't created by
Local-Code-Interpreter.The code cells get rerun to recreate the jupyter kernel state.
This behavior assumes that the output of the code is deterministic/reproducible which is usually the case for notebooks.
As of making this PR, if there happened to be a discrepancy between the old code output and the new one, the behavior is undefined.
Maybe we should ask the user what tho do when that happens, but it's not clear what options we would give him to remedy such discrepancy.
The code of
jupyter_backendandbot_backendmodules have been modified so that the working directory of the kernel is the same as the notebook this is to avoid output discrepancy due to file inputs.As of now, this branch is more of a place to discuss the implementation of jupyter kernel state deserialization than the actual final implementation.
The other possible solutions to this problem are:
This is effective but might add a layer of complexity though on every other feature.
It would also be more comber sum for sharing conversation compared to just sharing a notebook (and potentially some input files).
The main issues with this option is that dill cannot serialized every thing and that.
The serialized objects are kind of black boxes and might have compatibility issues between versions of
Local-Code-Interperter.Overall I believe that rerunning the code cell is the best option.
Let me know what you think, hopw this will be useful.