[candidate_isaac] opengpts: ingest progress bar and python eval tool #326
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.
A couple of notes
git add --interactive
I'll skip those ;)In this diff
/ingest
endpoint on the OpenGPTs server, stream updates back to the caller as each file completes uploading./ingest
Considerations
The key change in this section is to return a
StreamingResponse
around theingest_runnable.abatch_as_completed
async generator. Inserver.py
:Test Plan
Open OpenGPTs frontend in browser. Navigate to existing Thread and upload multiple files along with a dummy message. Observe that progress information is printed via.
console.log
.Modify source to omit
show_progress_bar
on the client side, and notice how no progress info is printed.Modify source to use previous and new versions of server side to show that providing
show_progress_bar
to server which does not understand it, does not cause any changes.For a smaller test case, you can use the following script to make an
/ingest
request:Python Source
Considerations
The main tradeoff in this script is how the Docker container gets created. There are two basic approaches that come to mind:
For this diff, I implemented the ad-hoc strategy because we don't have a compelling reason to add the complexity of the full server approach, and the ad-hoc approach is portable and flexible.
Test Plan
Provide the following Python source in e.g.
test.py
, and observe that easy escalations toroot
are not possible.