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

CV2-5011 refactors for making alegre dual purpose on text encoding #103

Merged
merged 8 commits into from
Aug 16, 2024

Conversation

DGaffney
Copy link
Collaborator

@DGaffney DGaffney commented Aug 5, 2024

Description

Minor tweak identified when running text encodings.

Reference: CV2-5011

How has this been tested?

Tested locally and confirmed to work

Are there any external dependencies?

Changes no dependencies

Have you considered secure coding practices when writing this code?

Does not alter security posture.

@DGaffney DGaffney marked this pull request as draft August 5, 2024 17:10
@DGaffney DGaffney marked this pull request as ready for review August 8, 2024 10:23
@DGaffney DGaffney requested a review from caiosba August 8, 2024 10:24
@caiosba caiosba requested a review from ashkankzme August 8, 2024 11:18
Copy link
Contributor

@caiosba caiosba left a comment

Choose a reason for hiding this comment

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

Sorry, I'm not familiarized with this code - but, does this change in the return require any change on Alegre side?

@DGaffney
Copy link
Collaborator Author

DGaffney commented Aug 8, 2024

Sorry, I'm not familiarized with this code - but, does this change in the return require any change on Alegre side?

It does not - the only thing that's happening here is basically updating vectorizers to return what is now the current specification for how responses from fingerprinters should look - this one got out of sync since we hadn't been using it for anything. Mostly just tagging you here for visibility so you can be aware of the magnitude of changes across each repo, don't worry too much about the specifics in this repo!

Copy link
Contributor

Choose a reason for hiding this comment

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

I realize this file has existed for a while, but is there a reason we override the respond() function instead of process()?
this would make this model unique and different from other Presto endpoints, and disables cache and error handling bc the standard get_response() function won't be called from model.py.

But I may be missing something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes - the reason we override is because we want to, from the get-go, natively be able to process jobs in batch on transformers instead of just walking through items one-by-one like we do with the others. I'll look into a refactor to keep our caching and error handling working for text though - good catch

Copy link
Contributor

@skyemeedan skyemeedan left a comment

Choose a reason for hiding this comment

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

the only thing that's happening here is basically updating vectorizers to return what is now the current specification for how responses from fingerprinters should look - this one got out of sync since we hadn't been using it for anything.

I'm not very clear how the output changed, but it looks like it will handle caching better? Is the current specification somewhere I can check if it matches? I'm just assuming it works because you said you tested it locally

@DGaffney
Copy link
Collaborator Author

the only thing that's happening here is basically updating vectorizers to return what is now the current specification for how responses from fingerprinters should look - this one got out of sync since we hadn't been using it for anything.

I'm not very clear how the output changed, but it looks like it will handle caching better? Is the current specification somewhere I can check if it matches? I'm just assuming it works because you said you tested it locally

That's basically it @skyemeedan - the function calling the fingerprinting function expects a slightly different response. Once we have the fixes from @ashkankzme on the PR he's working on it should be a bit easier to highlight conceptual float like this case.

Copy link
Collaborator

@computermacgyver computermacgyver left a comment

Choose a reason for hiding this comment

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

This looks fine for now. Thanks!
When we work on the bulk endpoints for Alegre, I think we're going to want one request to Presto to have a list of multiple text items to be vectorized. All of the vectors for those items should then be returned in one callback. I think some of the changes here may complicate that, but we can address it when we get to the bulk endpoints on Alegre.

self.model = GenericTransformerModel(None)
self.model.model_name = "generic"
self.model = AudioModel()
self.model.model_name = "audio"
Copy link
Contributor

@ashkankzme ashkankzme Aug 15, 2024

Choose a reason for hiding this comment

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

can we make sure model_name follows the same format as everywhere else, i.e. audio__Model? these names would break the tests in the new refactor

@DGaffney DGaffney merged commit 11c2f79 into master Aug 16, 2024
2 checks passed
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