-
Notifications
You must be signed in to change notification settings - Fork 68
Sd2 107 add new embeddings providers #219
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
@@ -63,7 +63,7 @@ def text__summarize( | |||
def image__embeddings( | |||
self, | |||
file: str, | |||
representation: str, | |||
representation: Optional[str], |
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.
Maybe you should a default value if representation is not provided:
representation: Optional[str] = None,
emotion_output[ | ||
emo.get("Type").lower() | ||
] = standardized_confidence_score(normalized_emo / 100) | ||
emotion_output[emo.get("Type").lower()] = ( |
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.
Just a small details, but I would have write: emo["Type] instead of emo.get("Type") as we are sure it has a value because there is an IF above
self, | ||
file: str, | ||
file_url: str = "", |
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.
I would have set file_url at the end, as it's the parameter the less likely to be set by a user if he uses our package. But it's also a small detail
|
||
items: Sequence[EmbeddingDataClass] = [] | ||
items.append(EmbeddingDataClass(embedding=original_response["embedding"])) |
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.
here, I would have done,
original_response.get("embedding", []) or []
in case there is not the key embedding
def image__embeddings( | ||
self, | ||
file: Optional[str], | ||
file_url: Optional[str] = "", |
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.
same here, but small details
items: Sequence[EmbeddingDataClass] = [] | ||
|
||
for prediction in original_response["predictions"]: | ||
items.append(EmbeddingDataClass(embedding=prediction["imageEmbedding"])) |
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.
same here also for the key "imageEmbedding"
@@ -122,7 +122,7 @@ def image__anonymization( | |||
def image__embeddings( | |||
self, | |||
file: str, | |||
representation: str, | |||
representation: Optional[str], |
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.
same here with a default value to None,
No description provided.