Upload code/data_builders/build_500m_sarus_1m_dataset.py with huggingface_hub
Browse files237 unmodified lines238239240241242243244245246247248249250251252253254255237 unmodified linesprint(f"\n🌐 [3/4] Streaming {remaining_needed:,} additional high-grade conversational samples from Hugging Face...")streams = [("HuggingFaceH4/ultrachat_200k", "train_sft", 4, int(remaining_needed * 0.40)),("teknium/OpenHermes-2.5", None, 6, int(remaining_needed * 0.35)),("HuggingFaceTB/cosmopedia", "web_samples", 2, int(remaining_needed * 0.25))]for ds_name, split, dom_id, count_target in streams:if count_target <= 0:continueprint(f" 🌊 Streaming from {ds_name} (Target: ~{count_target:,} samples)...")stream_count = 0try:ds = load_dataset(ds_name, split=split or "train", streaming=True, token=HF_TOKEN)for item in ds:inst, resp = "", ""if "messages" in item:237 unmodified lines238239240241242243244245246247248249250251252253254255256257258237 unmodified linesprint(f"\n🌐 [3/4] Streaming {remaining_needed:,} additional high-grade conversational samples from Hugging Face...")streams = [("HuggingFaceH4/ultrachat_200k", None, "train_sft", 4, int(remaining_needed * 0.40)),("teknium/OpenHermes-2.5", None, "train", 6, int(remaining_needed * 0.35)),("HuggingFaceTB/cosmopedia", "web_samples_v1", "train", 2, int(remaining_needed * 0.25))]for ds_name, config_name, split_name, dom_id, count_target in streams:if count_target <= 0:continueprint(f" 🌊 Streaming from {ds_name} ({config_name or 'default'}) (Target: ~{count_target:,} samples)...")stream_count = 0try:if config_name:ds = load_dataset(ds_name, config_name, split=split_name or "train", streaming=True, token=HF_TOKEN)else:ds = load_dataset(ds_name, split=split_name or "train", streaming=True, token=HF_TOKEN)for item in ds:inst, resp = "", ""if "messages" in item:
code/data_builders/build_500m_sarus_1m_dataset.py+9-6