Skip to content

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

Merged
merged 11 commits into from
Jul 8, 2024

Conversation

RedhaWassim
Copy link
Contributor

No description provided.

@@ -63,7 +63,7 @@ def text__summarize(
def image__embeddings(
self,
file: str,
representation: str,
representation: Optional[str],
Copy link
Contributor

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()] = (
Copy link
Contributor

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 = "",
Copy link
Contributor

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"]))
Copy link
Contributor

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] = "",
Copy link
Contributor

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"]))
Copy link
Contributor

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],
Copy link
Contributor

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,

BRAHIMI REDHA WASSIM added 2 commits July 8, 2024 12:01
@DninoAdnane DninoAdnane merged commit 48cd9f7 into master Jul 8, 2024
1 of 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.

2 participants