Feat/new data#6
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces support for new tiled datasets and updates the embedding preprocessing pipeline to handle multiple dataset URIs dynamically. These changes facilitate more flexible data ingestion and ensure the project dependencies are aligned with the latest toolkit versions. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces new configuration files for tiled datasets and experiment embeddings, alongside an update to the rationai-mlkit dependency. It also adds a resolve_dataset_uris function to the preprocessing module to handle dataset URIs. Feedback highlights a typo in the filename mou_3_2024.yaml and recommends enhancing the URI resolution logic to support multiple data formats and maintain backward compatibility with existing configurations.
| @@ -0,0 +1,6 @@ | |||
| # @package _global_ | |||
| def resolve_dataset_uris(config: DictConfig) -> list[str]: | ||
| """Resolve tiled dataset URIs from Hydra config.""" | ||
| if config.dataset.get("uris") is not None: | ||
| return [str(uri) for uri in config.dataset.uris.values()] | ||
|
|
||
| raise ValueError("Embeddings preprocessing requires `dataset.uris`.") |
There was a problem hiding this comment.
The current implementation of resolve_dataset_uris has two issues:
- It assumes
config.dataset.urisis always a mapping (by calling.values()). Ifurisis provided as a list in the configuration, it will raise anAttributeError. - It removes support for
config.dataset.path, which breaks backward compatibility for existing configurations.
Consider a more robust implementation that handles both mapping and list types for uris, and falls back to path if uris is missing.
def resolve_dataset_uris(config: DictConfig) -> list[str]:
"""Resolve tiled dataset URIs from Hydra config."""
dataset = config.get("dataset", {})
if (uris := dataset.get("uris")) is not None:
return [str(v) for v in (uris.values() if hasattr(uris, "values") else uris)]
if (path := dataset.get("path")) is not None:
return [str(path)]
raise ValueError("Embeddings preprocessing requires `dataset.uris` or `dataset.path`.")
No description provided.