Skip to content
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

Use PIL Image internally for the Multimodal Agent #1124

Merged
merged 16 commits into from
Feb 18, 2024
Merged

Conversation

BeibinLi
Copy link
Collaborator

@BeibinLi BeibinLi commented Jan 3, 2024

Why are these changes needed?

As many people have observed, saving a base64 string in _oai_messages would make debugging difficult because the string is so long that it would spam the terminal or output log (e.g., #1087). Therefore, we save a 'PIL image' inside _oai_messages and convert it to base64 before calling the OpenAI client.

Related issue number


Checks

@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2024

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (9708058) 39.46% compared to head (d0e49b9) 50.99%.

Files Patch % Lines
.../agentchat/contrib/multimodal_conversable_agent.py 59.09% 8 Missing and 1 partial ⚠️
autogen/agentchat/contrib/img_utils.py 93.18% 1 Missing and 2 partials ⚠️
autogen/agentchat/contrib/llava_agent.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1124       +/-   ##
===========================================
+ Coverage   39.46%   50.99%   +11.52%     
===========================================
  Files          57       57               
  Lines        6020     6073       +53     
  Branches     1346     1478      +132     
===========================================
+ Hits         2376     3097      +721     
+ Misses       3449     2726      -723     
- Partials      195      250       +55     
Flag Coverage Δ
unittests 50.91% <80.59%> (+11.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

debug, reformat
@sonichi sonichi added this pull request to the merge queue Feb 18, 2024
Merged via the queue into microsoft:main with commit 9de374a Feb 18, 2024
46 of 57 checks passed
@sonichi sonichi deleted the lmm branch February 18, 2024 16:06
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
* Change defualt model for `lmm`

* Try to use PIL image for LMM's _oai_messages

* Update test cases and llava

* Remove redundant files

* Update the imports for lmm tests

* Test case fix

* Docstring update

* LMM notebook lint

* Typo correction for img_utils and its test

* Update test_llava.py

debug, reformat

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Shaokun Zhang <shaokunzhang529@gmail.com>
Co-authored-by: Shaokun Zhang <shaokun.zhang@psu.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants