-
Notifications
You must be signed in to change notification settings - Fork 146
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
MultimodalQnA image query, pdf, and dynamic ports #1134
base: main
Are you sure you want to change the base?
Conversation
* Backend enhancements for image query capabilities for MultimodalQnA * Fix model name var Signed-off-by: dmsuehir <[email protected]> * Remove space at end of prompt Signed-off-by: dmsuehir <[email protected]> * Add env var for the max number of images sent to the LVM Signed-off-by: dmsuehir <[email protected]> * README update for the MAX_IMAGES env var Signed-off-by: dmsuehir <[email protected]> * Remove prints Signed-off-by: dmsuehir <[email protected]> * Audio query functionality to multimodal backend (#8) Signed-off-by: okhleif-IL <[email protected]> * added in audio dict creation Signed-off-by: okhleif-IL <[email protected]> * separated audio from prompt Signed-off-by: okhleif-IL <[email protected]> * added ASR endpoint Signed-off-by: okhleif-IL <[email protected]> * removed ASR endpoints from mm embedding Signed-off-by: okhleif-IL <[email protected]> * edited return logic, fixed function call Signed-off-by: okhleif-IL <[email protected]> * added megaservice to elif Signed-off-by: okhleif-IL <[email protected]> * reworked helper func Signed-off-by: okhleif-IL <[email protected]> * Append audio to prompt Signed-off-by: okhleif-IL <[email protected]> * Reworked handle messages, added metadata Signed-off-by: okhleif-IL <[email protected]> * Moved dictionary logic to right place Signed-off-by: okhleif-IL <[email protected]> * changed logic to rely on message len Signed-off-by: okhleif-IL <[email protected]> * list --> empty str Signed-off-by: okhleif-IL <[email protected]> --------- Signed-off-by: Melanie Buehler <[email protected]> Signed-off-by: okhleif-IL <[email protected]> Signed-off-by: dmsuehir <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed role bug where i never was > 0 Signed-off-by: okhleif-IL <[email protected]> * Fix after merge Signed-off-by: dmsuehir <[email protected]> * removed whitespace Signed-off-by: okhleif-IL <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix call to get role labels Signed-off-by: dmsuehir <[email protected]> * Gateway test updates images within the conversation Signed-off-by: dmsuehir <[email protected]> * Adds unit test coverage for audio query Signed-off-by: Melanie Buehler <[email protected]> * Update test to check the returned b64 types Signed-off-by: dmsuehir <[email protected]> * Update test since we don't expect images from the assistant Signed-off-by: dmsuehir <[email protected]> * Port number fix Signed-off-by: Melanie Buehler <[email protected]> * Formatting Signed-off-by: Melanie Buehler <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed place where port number is set Signed-off-by: Melanie Buehler <[email protected]> * Remove old comment and added more accurate description Signed-off-by: dmsuehir <[email protected]> * add comment in code about MAX_IMAGES Signed-off-by: dmsuehir <[email protected]> * Add Gaudi support for image query Signed-off-by: dmsuehir <[email protected]> * Fix to pass the retrieved image last Signed-off-by: dmsuehir <[email protected]> * Revert out gateway and gateway test code, due to its move to GenAIExamples Signed-off-by: dmsuehir <[email protected]> * Fix retriever test for checking for b64_img_str in the result Signed-off-by: dmsuehir <[email protected]> --------- Signed-off-by: dmsuehir <[email protected]> Signed-off-by: Melanie Buehler <[email protected]> Signed-off-by: okhleif-IL <[email protected]> Co-authored-by: Omar Khleif <[email protected]> Co-authored-by: Melanie Hart Buehler <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Abolfazl Shahbazi <[email protected]>
Signed-off-by: Melanie Buehler <[email protected]>
…nv file (#17) * changed all hardcoded ports to getenv with defaults instead Signed-off-by: okhleif-IL <[email protected]> --------- Signed-off-by: okhleif-IL <[email protected]>
* Initial implementation of PDF ingestion Signed-off-by: Melanie Buehler <[email protected]> * PDF ingestion fixes Signed-off-by: Melanie Buehler <[email protected]> * Adds a test for dataprep microservice Signed-off-by: Melanie Buehler <[email protected]> * Improved comments, variable name, and a docstring Signed-off-by: Melanie Buehler <[email protected]> * Updated for review feedback Signed-off-by: Melanie Buehler <[email protected]> --------- Signed-off-by: Melanie Buehler <[email protected]>
…ge-query Signed-off-by: dmsuehir <[email protected]>
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
Signed-off-by: Melanie Buehler <[email protected]>
for frame in annotation: | ||
page_index = frame["frame_no"] | ||
image_index = frame["sub_video_id"] | ||
path_to_frame = os.path.join(path_to_frames, f"page{page_index}_image{image_index}.png") |
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.
@mhbuehler Anyway, this is a new function. Why do we need to preserve the name of local variables relating to frames/videos (e.g., path_to_frame, video_id)? This might cause confusion.
@@ -106,7 +106,7 @@ async def audio_transcriptions( | |||
if __name__ == "__main__": | |||
parser = argparse.ArgumentParser() | |||
parser.add_argument("--host", type=str, default="0.0.0.0") | |||
parser.add_argument("--port", type=int, default=7066) | |||
parser.add_argument("--port", type=int, default=os.getenv("WHISPER_PORT", 7066)) |
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.
The internal container server port can be forwarded to any arbitrary host port. Why we need this also to be configurable?
@@ -34,7 +34,7 @@ | |||
service_type=ServiceType.ASR, | |||
endpoint="/v1/audio/transcriptions", | |||
host="0.0.0.0", | |||
port=9099, | |||
port=int(os.getenv("ASR_PORT", 9099)), | |||
input_datatype=Base64ByteStrDoc, |
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.
Same question as above.
Description
According to the RFC's Phase 2 plan, this PR adds image query support, PDF ingestion support, and dynamic ports to the microservices used by MultimodalQnA. This PR goes with this one in GenAIExamples.
Issues
RFC
Type of change
List the type of change like below. Please delete options that are not relevant.
Dependencies
pymupdf is new for the dataprep microservice, but it's not new to GenAIComps.
Tests
Tests were added to the following scripts: