Datasets:
Tasks:
Text Generation
Languages:
English
Size:
n<1K
Tags:
code
notebooks
training-scripts
dataset:Nanthasit/sakthai-kaggle-notebooks
license-mit
dataset-card
License:
Upload scripts/push-all-to-hub.py with huggingface_hub
Browse files- scripts/push-all-to-hub.py +71 -0
scripts/push-all-to-hub.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# /// script
|
| 3 |
+
# dependencies = ["datasets", "huggingface_hub"]
|
| 4 |
+
# ///
|
| 5 |
+
"""Push all augmented datasets to Hugging Face Hub as sakthai-combined-v8.
|
| 6 |
+
Uploads as raw JSONL files (avoids pyarrow schema issues with nested tool_calls)."""
|
| 7 |
+
import json, os
|
| 8 |
+
from huggingface_hub import HfApi
|
| 9 |
+
|
| 10 |
+
api = HfApi()
|
| 11 |
+
repo = "Nanthasit/sakthai-combined-v8"
|
| 12 |
+
|
| 13 |
+
# 1. Create repo
|
| 14 |
+
api.create_repo(repo_id=repo, repo_type="dataset", exist_ok=True)
|
| 15 |
+
|
| 16 |
+
# 2. Upload training-data-ready.jsonl (538 augmented examples)
|
| 17 |
+
api.upload_file(
|
| 18 |
+
path_or_fileobj="training-data-ready.jsonl",
|
| 19 |
+
path_in_repo="data/augmented.jsonl",
|
| 20 |
+
repo_id=repo,
|
| 21 |
+
repo_type="dataset",
|
| 22 |
+
)
|
| 23 |
+
print("Uploaded augmented.jsonl")
|
| 24 |
+
|
| 25 |
+
# 3. Also upload as train split
|
| 26 |
+
api.upload_file(
|
| 27 |
+
path_or_fileobj="training-data-ready.jsonl",
|
| 28 |
+
path_in_repo="data/train.jsonl",
|
| 29 |
+
repo_id=repo,
|
| 30 |
+
repo_type="dataset",
|
| 31 |
+
)
|
| 32 |
+
print("Uploaded train.jsonl")
|
| 33 |
+
|
| 34 |
+
# 4. Create a simple README
|
| 35 |
+
readme = f"""---
|
| 36 |
+
license: apache-2.0
|
| 37 |
+
language: [en, th]
|
| 38 |
+
tags: [sakthai, tool-calling, function-calling, augmented, v8]
|
| 39 |
+
---
|
| 40 |
+
# SakThai Combined Dataset v8
|
| 41 |
+
|
| 42 |
+
{len(open('training-data-ready.jsonl').readlines())} augmented tool-calling examples.
|
| 43 |
+
Extends v7 with targeted data addressing benchmark gaps.
|
| 44 |
+
|
| 45 |
+
## Contents
|
| 46 |
+
- `data/augmented.jsonl` — 538 deduplicated augmented examples
|
| 47 |
+
- `data/train.jsonl` — same data as train split
|
| 48 |
+
|
| 49 |
+
## Augmentation strategies
|
| 50 |
+
1. Arguments normalization (norm() whitespace/case)
|
| 51 |
+
2. Parallel calls (Counter multiset containment)
|
| 52 |
+
3. Irrelevance (empty pred_names)
|
| 53 |
+
4. Hard negatives (selection accuracy)
|
| 54 |
+
5. Held-out tool generalization
|
| 55 |
+
6. Argument type coercion
|
| 56 |
+
7. Multi-turn context tracking
|
| 57 |
+
8. Multi-hop chains
|
| 58 |
+
9. Pure tool-calling (no chat dilution)
|
| 59 |
+
10. Strict accuracy (selection + arguments)
|
| 60 |
+
|
| 61 |
+
See also: [v7](https://huggingface.co/datasets/Nanthasit/sakthai-combined-v7)
|
| 62 |
+
"""
|
| 63 |
+
api.upload_file(
|
| 64 |
+
path_or_fileobj=readme.encode(),
|
| 65 |
+
path_in_repo="README.md",
|
| 66 |
+
repo_id=repo,
|
| 67 |
+
repo_type="dataset",
|
| 68 |
+
)
|
| 69 |
+
print("Uploaded README.md")
|
| 70 |
+
print(f"\nDone: https://huggingface.co/datasets/{repo}")
|
| 71 |
+
print(f" Download: load_dataset('{repo}', split='train')")
|