Repository navigation
[FEATURE] organize preprocessing module - #3
Conversation
- divide original class into multiple classes - create GCSStorage for gcs based file storage - create LocalStorage for local file storage - remove original file NOTE: This commit was made for organization purpose, code doesn't work at this commit because the changes aren't implemented in other related modules
as the two dataset classes (DataHandler and DataPreprocessor) had multiple overlapping functionality, I divided into smaller submodule for better handling and maintainance - introduce DataAnalyzer for analyzing the dataset - introduce DataLoader for loading the dataset (it loads the dataset from local file storage, hugging face or a demo one) - introduce DataUploader (handles uploading of local dataset) - introduce FormatConverter for converting processing the dataset - introduce DatasetService which utilizes all above classes (this one is used in the fastapi app) NOTE: Please note that the app doesn't work at this commit, it was made for the purpose of organization. Other modules that use the changed one haven't been edited yet.
this commit uses all the previous changes, and the app should be usable now
8daea0e to
533e464
Compare
…ation - Updated the preview and processing endpoints to include comprehensive documentation on field mappings. - Refined the configuration structure to support field mappings with types and values, allowing for more flexible data handling. - Adjusted the format converter to accommodate the new field mapping structure, ensuring proper extraction and formatting of user and system messages.
supreme-gg-gg
left a comment
There was a problem hiding this comment.
splitting logic looks good
|
Not necessary to implement right now but it seems to me like hugging face also allows you to specify
from datasets import load_dataset
# load files that match the grep pattern
c4_subset = load_dataset("allenai/c4", data_files="en/c4-train.0000*-of-01024.json.gz")
# load dataset from the en directory on the Hub
c4_subset = load_dataset("allenai/c4", data_dir="en")
The split parameter can also map a data file to a specific split:
data_files = {"validation": "en/c4-validation.*.json.gz"}
c4_validation = load_dataset("allenai/c4", data_files=data_files, split="validation")I believe this is one example dataset of where this is useful: https://huggingface.co/datasets/allenai/c4 |
|
Also I believe the first version of prototype uses augmented_dataset = dataset.map(function, batched=True, remove_columns=dataset.column_names, batch_size=8)I also believe it has better built in support to convert to pytorch tensor types if we ever run into an incompatibility in the future |
[Feature] Add augmentation to preprocessing workflow
|
It seems like I accidentally overwritten the Dockerfile to not use uv, i will find out which commit and revert it soon |
There was a problem hiding this comment.
LGTM overall, feel free to merge but make sure:
- Check
preprocess/README.mdto update the API docs and usage - Test the modules (especially integration) if needed by just running locally and with GCS (the bucket is
gemma-dataset-bucketon the gcp project - If you can test the integration with augmentation as well (just the Gemini synthesis is fine), if you run into package issues let me know but unlikely if you're running locally
Won't recommend building to cloud yet because there's a Dockerfile and update from the other branch, you can deploy it after the other branch is merged 😄
…d implementations
|
@supreme-gg-gg I have tested the GCS data storage, and it works perfectly. I have also made few necessary changes and updated the README file. I wasn't able to test the augmentation integration; I need your help with it. It'll be great if you could test it out, or getting on a meet to discuss it would be better. Otherwise, I believe this PR is ready to be merged. |
Great, I will test the augmentation and get back to you |
|
This PR looks good. Merging it now. |
No description provided.