-
Notifications
You must be signed in to change notification settings - Fork 0
Added text ai wrapper interface #166
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
Merged
MarleneKress79789
merged 4 commits into
main
from
feature/#164_add_text_ai_wrapper_interface
Mar 5, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| from typing import Optional | ||
|
|
||
| from exasol.nb_connector.secret_store import Secrets | ||
| from pathlib import Path | ||
|
|
||
| LANGUAGE_ALIAS = "PYTHON3_TXAIE" | ||
|
|
||
| LATEST_KNOWN_VERSION = "???" | ||
|
|
||
| def deploy_licence(conf: Secrets, | ||
| licence_file: Optional[Path] = None, | ||
| licence_content: Optional[str] = None) -> None: | ||
| """ | ||
| Deploys the given license and saves its identifier to the secret store. The licence can either be | ||
| defined by a path pointing to a licence file, or by the licence content given as a string. | ||
| Parameters: | ||
| conf: | ||
| The secret store. | ||
| licence_file: | ||
| Optional. Path of a licence file. | ||
| licence_content: | ||
| Optional. Content of a licence given as a string. | ||
|
|
||
| """ | ||
| pass | ||
|
|
||
| def initialize_text_ai_extension(conf: Secrets, | ||
| container_file: Optional[Path] = None, | ||
| version: Optional[str] = LATEST_KNOWN_VERSION, | ||
| language_alias: str = LANGUAGE_ALIAS, | ||
| run_deploy_container: bool = True, | ||
| run_deploy_scripts: bool = True, | ||
| run_upload_models: bool = True, | ||
| run_encapsulate_bfs_credentials: bool = True, | ||
| allow_override: bool = True) -> None: | ||
| """ | ||
| Depending on which flags are set, runs different steps to install Text-AI Extension in the DB. | ||
| Possible steps: | ||
|
|
||
| * Call the Text-AI Extension's language container deployment API. | ||
| If given a version, downloads the specified released version of the extension from ??? | ||
| and uploads it to the BucketFS. | ||
|
|
||
| If given a container_file path instead, installs the given container in the Bucketfs. | ||
|
|
||
| If neither is given, attempts to install the latest version from ???. | ||
|
|
||
| This function doesn't activate the language container. Instead, it gets the | ||
| activation SQL using the same API and writes it to the secret store. The name | ||
| of the key is defined in the ACTIVATION_KEY constant. | ||
|
|
||
| * Install default transformers models into | ||
| the Bucketfs using Transformers Extensions upload model functionality. | ||
|
|
||
| * Install Text-AI specific scripts. | ||
|
|
||
| Parameters: | ||
| conf: | ||
| The secret store. The store must contain the DB connection parameters | ||
| and the parameters of the BucketFS service. | ||
| container_file: | ||
| Optional. Path pointing to the locally stored Script Language Container file for the Text-AI Extension. | ||
| version: | ||
| Optional. Text-AI extension version. | ||
| language_alias: | ||
| The language alias of the extension's language container. | ||
| run_deploy_container: | ||
| If True runs deployment of the locally stored Script Language Container file for the Text-AI Extension. | ||
| run_deploy_scripts: | ||
| If True runs deployment of Text-AI Extension scripts. | ||
| run_upload_models: | ||
| If True uploads default Transformers models to the BucketFS. | ||
| run_encapsulate_bfs_credentials: | ||
| If set to False will skip the creation of the text ai specific database connection | ||
| object encapsulating the BucketFS credentials. | ||
| allow_override: | ||
| If True allows overriding the language definition. | ||
| """ | ||
| pass | ||
Oops, something went wrong.
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.
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.
We don't have scripts to deploy. Neither do we have any models to upload upfront.
But we probably need the BucketFS credentials and HF token, just like the TE.
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.
yes but we plan on having scripts and default models in the future, and want to prevent having to change the interface to often.
i am not sure about the HF token. that one is for private models, and i doubt we will have private models as default models for text ai, which are the only ones this installer will use. @tkilias what do you think?
Bucketfs credential you might be right. i thought those would be given through the secret store? is this not the case?
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.
With regards to the private token, as far as I am concerned, there is no difference between the Text AI and TE.
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.
User might use private models, so the token is needed
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.
Regarding bucketfs credentials that comes from the AI Lab config
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.
We will have scripts and default models. Scripts will be added in Q2 in form of span functions and default models, we actually will need already this quarter.
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.
having the HF token here still seems kinda iffy to me. this call does not need them. unless we allow users to set default model? which seem not default then.
otherwise if people want to install additional private models, should that not happen via a different call, which then can also be used to set the token?
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.
we can also remove the hf token, have no strong feelings about it