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

Tgis auto finder #123

Merged
merged 13 commits into from
Aug 10, 2023
Merged

Tgis auto finder #123

merged 13 commits into from
Aug 10, 2023

Conversation

gabe-l-hart
Copy link
Contributor

Description

This PR introduces the TGISAutoFinder which implements the ModelFinderBase interface. When configured in model_management.finders, this allows caikit.load (and by extension caikit.runtime model loading) to automatically find models that are managed by TGIS for the text-generation task without needing those models to exist on-disk with a config.yml file.

Example

k port-forward svc/bloom-560m-inference-server 8033
import caikit
from caikit_nlp.model_management import TGISAutoFinder
caikit.configure(
    config_dict={
        "model_management": {
            "finders": {
                "default": {
                    "type": TGISAutoFinder.name,
                    "config": {},
                }
            },
            "initializers": {
                "default": {
                    "type": "LOCAL",
                    "config": {
                        "backend_priority": [
                            {
                                "type": "TGIS",
                                "config": {
                                    "connection": {
                                        "hostname": "localhost:8033",
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        }
    }
)

model = caikit.load("flan-t5-xl")

This is now done in the tgis backend itself

Signed-off-by: Gabe Goodhart <[email protected]>
…e from the finder

This requires that the module know that it may receive an in-memory
ModuleConfig which may have a tgis_backend attribute set

Signed-off-by: Gabe Goodhart <[email protected]>
This is there to meet the factory abstract interface, but it's not used so
if someone ever did want to create an instance manually (which is a valid
usecase when using `caikit.load` directly), we don't want to require it.

Signed-off-by: Gabe Goodhart <[email protected]>
Signed-off-by: Gabe Goodhart <[email protected]>
Copy link
Collaborator

@gkumbhat gkumbhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. Thanks Gabe!

@gabe-l-hart gabe-l-hart merged commit 2650797 into caikit:main Aug 10, 2023
4 checks passed
@gabe-l-hart gabe-l-hart deleted the TgisAutoFinder branch August 10, 2023 16:37
gkumbhat pushed a commit to gkumbhat/caikit-nlp that referenced this pull request Aug 24, 2023
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.

None yet

2 participants