-
Notifications
You must be signed in to change notification settings - Fork 54
Added cli to convert legacy fine tuned model to v2. #1241
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
Conversation
or legacy_tags.get(Tags.AQUA_FINE_TUNE_MODEL_VERSION, UNKNOWN).lower() | ||
== AQUA_FINE_TUNE_MODEL_VERSION | ||
): | ||
raise AquaValueError( |
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.
raise AquaValueError(
f"Model '{model_id}' is not eligible for conversion. Only legacy AQUA fine-tuned models "
f"without the 'fine_tune_model_version={AQUA_FINE_TUNE_MODEL_VERSION}' tag are supported."
)
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.
Updated
.create(model_by_reference=True) | ||
) | ||
|
||
logger.info( |
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.
f"Successfully created version '{AQUA_FINE_TUNE_MODEL_VERSION}' fine-tuned model: '{fine_tune_model_v2.id}' "
f"based on legacy model '{model_id}'. This model is now ready for deployment."
)```
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.
Updated
) | ||
|
||
if not legacy_fine_tuned_model.model_file_description: | ||
raise AquaValueError( |
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.
raise AquaValueError(
f"Model '{model_id}' is missing required metadata and cannot be converted. "
"This may indicate the model was not created properly or is not a supported legacy AQUA fine-tuned model."
)
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.
Updated
@@ -645,6 +646,80 @@ def edit_registered_model( | |||
else: | |||
raise AquaRuntimeError("Only registered unverified models can be edited.") | |||
|
|||
def convert_fine_tune( |
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 need to add one more validation, in case if model is already converted to V2, we should inform user about this and say:
logger.info(
f"Model '{model_id}' is already a fine-tuned model in version '{AQUA_FINE_TUNE_MODEL_VERSION}'. "
"No conversion is necessary."
)
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.
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.
Let's make it more explicit. I mean for this use case let's show the dedicated message that I've posted above. Otherwise users might think that something wrong with their model.
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.
Updated
Added cli to convert legacy fine tuned model to v2.
convert_fine_tune
to convert legacy fine tuned model to v2.Integration
fine_tune_model_version
and only fine tune artifacts inmodel_file_description.json
Unit