Conversation
Batching queries skill manager
Add BATCH_SIZE variable to docker-compose
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
This PR adds batching functionality to the evaluator for query calls to the skill manager. Instead of sending a query call for each data point, data points are "batched" into a single request and the skill manager returns the predictions for all data points at once.
Who can review?
@HaritzPuerto
@timbmg
Test locally
To test this PR locally
change square-core/skill-manager/Dockerfile to:
change square-core/skills/Dockefile to
change urls to call locally running skill-manager and extractive-qa skill.
Add the following docker-compose to the project root folder:
If skills not running locally (inference not possible), test batching by adding a mocked response to the extractive-qa skill in square-core/skills/extractive-qa/skill.py:
Replace the call to the model or the model_response with a call to the method mocking the response from the model in .
model_response = get_model_response_topk_1_for_evaluator()Mocked data response is for query with batch size 2, make sure to add only 2 questions to the query, for example add queries = queries[:2] at https://github.com/nclskfm/square-core/blob/master/skill-manager/skill_manager/routers/skill.py#L303
Clone the square-skill-api repo to the parent folder of the square-core project. Folder structure should look like this:
change the query attribute of the QueryRequest class in https://github.com/UKP-SQuARE/square-skill-api/blob/master/square_skill_api/models/request.py#L97 to this:
Make sure to import Union and List.
Go to root folder and run the following command from your terminal:
go to the square-core folder and run the following command:
I hope i didnt forget anything :)