-
Notifications
You must be signed in to change notification settings - Fork 0
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
Breaking down large files into smaller chunks based on context window size #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes required. The updates made to the files are beneficial, particularly the changes to read files in chunks which can help handle large files more efficiently. Good job!
Sweep: I don't see the read_file_in_chunks method in utils |
gpt_migrate/utils.py
Outdated
with open(file_path, 'r') as file: | ||
while True: | ||
data = file.read(chunk_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to read it in chunks of lines instead, and return an array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks William! Tested it with the benchmarks and they run as expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @0xpayne sorry about the delay! I just wrote a new one, this should be much better
I added all these code edits but I still have an error when executing.
|
Description
This PR implements a chunking mechanism to break down large files into smaller chunks based on a configurable context window size. This will improve the handling of large files in the codebase.
Changes Made
gpt_migrate/config.py
to specify the context window size.gpt_migrate/utils.py
to read files in chunks based on the context window size.gpt_migrate/steps/debug.py
:debug_error
gpt_migrate/steps/test.py
:run_dockerfile
,create_tests
,validate_tests
,run_test
gpt_migrate/steps/migrate.py
:get_dependencies
,write_migration
Checklist
Related Issue
This PR addresses the issue #1.
Screenshots (if applicable)
N/A
Fixes #1.
To checkout this PR branch, run the following command in your terminal: