omg-data
Automatic HuggingFace dataset pipeline for OMGFormer — download, clean, tokenize.
One call handles everything: finding the right datasets for your language & task, downloading them, cleaning the text, and producing a ready-to-train OMGDataset.
Installation
pip install omg-data
# with language detection support
pip install omg-data[langdetect]
Quick Start
from omg_data import DataPipeline
# Türkçe, 5 GB, GPT-2 tokenizer
pipe = DataPipeline(
language="tr",
size_gb=5,
tokenizer="gpt2",
)
dataset = pipe.build()
trainer.fit(dataset) # OMGFormer Trainer ile doğrudan uyumlu
Examples
Task-specific pipeline
pipe = DataPipeline(
language="en",
task="chat", # "text" | "chat" | "instruction" | "qa" | "code" | ...
size_gb=10,
tokenizer="meta-llama/Llama-2-7b-hf",
seq_len=2048,
)
dataset = pipe.build()
Custom datasets
pipe = DataPipeline(
language="en",
tokenizer="gpt2",
custom_datasets=["wikitext", "openwebtext"],
)
dataset = pipe.build()
Cleaning disabled
pipe = DataPipeline(language="en", tokenizer="gpt2", clean=False)
dataset = pipe.build()
Fine-grained cleaning control
pipe = DataPipeline(
language="tr",
tokenizer="gpt2",
clean=True,
clean_options={
"dedup": True,
"min_chars": 50,
"remove_urls": True,
"remove_html": True,
"lang_filter": True,
},
)
Raw text (no tokenizer)
pipe = DataPipeline(language="de", size_gb=2)
hf_dataset = pipe.build() # returns HuggingFace Dataset
Supported Languages
tr en de fr es ar ru ja zh ko pt it nl pl sv
Supported Tasks
text · lm · chat · conversation · instruction · instruct · qa · summarization · classification · code
Pipeline Steps
- Search — Finds suitable HuggingFace datasets for your language & task
- Download — Streams & caches datasets via HuggingFace
datasets - Clean — Removes HTML, URLs, duplicates, fixes Unicode, filters by length
- Tokenize — Chunks text into fixed-length token windows
- Return —
OMGDataset(PyTorchDataset) ready fortrainer.fit()
OMGDataset API
from omg_data import OMGDataset
# Compatible with any PyTorch DataLoader
loader = torch.utils.data.DataLoader(dataset, batch_size=32, shuffle=True)
# Info
print(dataset.info())
# {'num_sequences': 125000, 'seq_len': 512, 'total_tokens': 64000000, 'approx_size_gb': 0.128}
License
Apache-2.0
Metadata
Release files for omg-data 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| omg_data-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for omg_data-1.0.1-py3-none-any.whl |
Release files / omg_data-1.0.1-py3-none-any.whl
| Download URL | omg_data-1.0.1-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0fcf9b249d5c4c5549aee767010797864b2692b8342e79dd09c36ea1be8866d
|
|
BLAKE2b-256 checksum How to use checksums |
c1cfd12b206316cdddb773ab0f6d61d54c51859005454cdbf1178f7e714aaba2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for omg-data 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.