Garden-AI / garden

https://garden-ai.readthedocs.io
MIT License
16 stars 4 forks source link

Add logic to format DLHub model input and output correctly #410

Closed WillEngler closed 5 months ago

WillEngler commented 5 months ago

This came up in the course of #402

Overview

DLHub wraps user input to models in a dictionary before sending it along to Globus Compute. Similarly, when receiving output from a successful run, DLHub unwraps the output from a nested tuple and returns the inner output to the user.

This PR makes it so that Garden will do the same for the legacy DLHub models we're migrating.

Discussion

This is a little kludgey but good enough for now. We might be able to do something a little fancier where we add this code to the DLHub functions registered with Globus Compute if/when we want to get rid of this little hack.

Testing

I tested this against sample input and output I got from a DLHub model that I migrated to Garden dev. I also added new unit tests. We will still need to test this end to end in the context of the full migration dry run on dev.

Documentation

None


📚 Documentation preview 📚: https://garden-ai--410.org.readthedocs.build/en/410/

codecov-commenter commented 5 months ago

Codecov Report

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

Comparison is base (72f713d) 75.58% compared to head (fb0224d) 76.08%.

Files Patch % Lines
garden_ai/entrypoints.py 83.33% 2 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #410 +/- ## ========================================== + Coverage 75.58% 76.08% +0.49% ========================================== Files 45 46 +1 Lines 2757 2789 +32 ========================================== + Hits 2084 2122 +38 + Misses 673 667 -6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.