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

add client packages #382

Merged
merged 1 commit into from
Sep 24, 2024
Merged

add client packages #382

merged 1 commit into from
Sep 24, 2024

Conversation

michaelfeil
Copy link
Owner

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.78%. Comparing base (d6cdaf3) to head (4c49d30).
Report is 1 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #382   +/-   ##
=======================================
  Coverage   77.78%   77.78%           
=======================================
  Files          37       37           
  Lines        2804     2804           
=======================================
  Hits         2181     2181           
  Misses        623      623           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR introduces audio embedding support and enhances encoding formats for embeddings in the Infinity client packages.

  • Added libs/client_infinity/infinity_client/infinity_client/api/default/embeddings_audio.py for audio embedding API endpoint
  • Introduced AudioEmbeddingInput class in libs/client_infinity/infinity_client/infinity_client/models/audio_embedding_input.py for handling audio embedding requests
  • Created EmbeddingEncodingFormat enum in libs/client_infinity/infinity_client/infinity_client/models/embedding_encoding_format.py to define BASE64 and FLOAT encoding formats
  • Updated EmbeddingObject class in embedding_object.py to support both List[float] and File types for embeddings
  • Modified libs/embed_package/pyproject.toml to use a specific version (0.0.58) of infinity_emb instead of a local path

13 file(s) reviewed, 11 comment(s)
Edit PR Review Bot Settings

Comment on lines +73 to +75
requests.post(\"http://..:7997/embeddings_audio\",
json={\"model\":\"laion/larger_clap_general\",\"input\":[\"https://github.com/michaelfeil/infini
ty/raw/3b72eb7c14bae06e68ddd07c1f23fe0bf403f220/libs/infinity_emb/tests/data/audio/beep.wav\"]})
Copy link
Contributor

Choose a reason for hiding this comment

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

style: URL in example is incomplete. Consider using a placeholder or full example URL

Comment on lines +110 to +112
requests.post(\"http://..:7997/embeddings_audio\",
json={\"model\":\"laion/larger_clap_general\",\"input\":[\"https://github.com/michaelfeil/infini
ty/raw/3b72eb7c14bae06e68ddd07c1f23fe0bf403f220/libs/infinity_emb/tests/data/audio/beep.wav\"]})
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Duplicate code from sync_detailed function. Consider refactoring to avoid repetition

Comment on lines +142 to +144
requests.post(\"http://..:7997/embeddings_audio\",
json={\"model\":\"laion/larger_clap_general\",\"input\":[\"https://github.com/michaelfeil/infini
ty/raw/3b72eb7c14bae06e68ddd07c1f23fe0bf403f220/libs/infinity_emb/tests/data/audio/beep.wav\"]})
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Duplicate code from sync_detailed function. Consider refactoring to avoid repetition

Comment on lines +177 to +179
requests.post(\"http://..:7997/embeddings_audio\",
json={\"model\":\"laion/larger_clap_general\",\"input\":[\"https://github.com/michaelfeil/infini
ty/raw/3b72eb7c14bae06e68ddd07c1f23fe0bf403f220/libs/infinity_emb/tests/data/audio/beep.wav\"]})
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Duplicate code from sync_detailed function. Consider refactoring to avoid repetition

embedding_type_0 = cast(List[float], data)

return embedding_type_0
except: # noqa: E722
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Avoid bare except clauses. Catch specific exceptions or at least use except Exception:.

index (int):
object_ (Union[Unset, EmbeddingObjectObject]): Default: EmbeddingObjectObject.EMBEDDING.
"""

embedding: List[float]
embedding: Union[File, List[float]]
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Update the docstring to reflect the new Union[File, List[float]] type for embedding.

@@ -14,11 +15,13 @@ class ImageEmbeddingInput:
Attributes:
input_ (Union[List[str], str]):
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider updating the docstring to include a description of the encoding_format attribute

@@ -14,11 +15,13 @@ class ImageEmbeddingInput:
Attributes:
input_ (Union[List[str], str]):
model (Union[Unset, str]): Default: 'default/not-specified'.
encoding_format (Union[Unset, EmbeddingEncodingFormat]):
user (Union[None, Unset, str]):
"""

input_: Union[List[str], str]
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: input_ type is Union[List[str], str], but docstring suggests it should be List[str] or str for image URLs

@michaelfeil michaelfeil merged commit 6c1ad68 into main Sep 24, 2024
36 checks passed
@michaelfeil michaelfeil deleted the mf-update-client-packages branch September 24, 2024 06:04
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