Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,48 +1,129 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
list: string
|
| 18 |
-
- name: difficulty
|
| 19 |
-
dtype: string
|
| 20 |
-
- name: style
|
| 21 |
-
dtype: string
|
| 22 |
-
- name: apis
|
| 23 |
-
list: string
|
| 24 |
-
- name: esp_idf_version_note
|
| 25 |
-
dtype: string
|
| 26 |
-
- name: source
|
| 27 |
-
dtype: string
|
| 28 |
-
- name: multi_turn
|
| 29 |
-
dtype: bool
|
| 30 |
-
- name: fact_item_id
|
| 31 |
-
dtype: string
|
| 32 |
-
splits:
|
| 33 |
-
- name: train
|
| 34 |
-
num_bytes: 1854053
|
| 35 |
-
num_examples: 1101
|
| 36 |
-
- name: validation
|
| 37 |
-
num_bytes: 102483
|
| 38 |
-
num_examples: 59
|
| 39 |
-
download_size: 1962178
|
| 40 |
-
dataset_size: 1956536
|
| 41 |
-
configs:
|
| 42 |
-
- config_name: default
|
| 43 |
-
data_files:
|
| 44 |
-
- split: train
|
| 45 |
-
path: data/train-*
|
| 46 |
-
- split: validation
|
| 47 |
-
path: data/validation-*
|
| 48 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: mit
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
tags:
|
| 8 |
+
- freertos
|
| 9 |
+
- esp32
|
| 10 |
+
- esp-idf
|
| 11 |
+
- qwen
|
| 12 |
+
- unsloth
|
| 13 |
+
- code
|
| 14 |
+
pretty_name: FreeRTOS ESP32
|
| 15 |
+
size_categories:
|
| 16 |
+
- 1K<n<10K
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
---
|
| 18 |
+
|
| 19 |
+
# FreeRTOS ESP32
|
| 20 |
+
|
| 21 |
+
Instructional **ChatML** dataset for fine-tuning language models (e.g. **Qwen** via **Unsloth**) as an expert **ESP32 / ESP-IDF / FreeRTOS** assistant.
|
| 22 |
+
|
| 23 |
+
Content is original instructional material oriented around ESP-IDF v5.x FreeRTOS APIs and idioms — not a verbatim dump of vendor documentation.
|
| 24 |
+
|
| 25 |
+
## Dataset summary
|
| 26 |
+
|
| 27 |
+
| Item | Value |
|
| 28 |
+
|------|--------|
|
| 29 |
+
| Format | Hub `Dataset` / JSONL with ChatML `messages` (`system` / `user` / `assistant`) |
|
| 30 |
+
| Total examples | **1160** |
|
| 31 |
+
| Train | **1101** |
|
| 32 |
+
| Validation | **59** (~5%, stratified by category) |
|
| 33 |
+
| License | MIT |
|
| 34 |
+
| Language | English |
|
| 35 |
+
| Focus | FreeRTOS on ESP32 (ESP-IDF), embedded C, real-time patterns |
|
| 36 |
+
|
| 37 |
+
Each row has a `messages` list (ChatML) and a `meta` object (id, category, tags, difficulty, style, APIs, etc.).
|
| 38 |
+
|
| 39 |
+
### Schema
|
| 40 |
+
|
| 41 |
+
```json
|
| 42 |
+
{
|
| 43 |
+
"messages": [
|
| 44 |
+
{"role": "system", "content": "..."},
|
| 45 |
+
{"role": "user", "content": "..."},
|
| 46 |
+
{"role": "assistant", "content": "..."}
|
| 47 |
+
],
|
| 48 |
+
"meta": {
|
| 49 |
+
"id": "tasks_basic_0042",
|
| 50 |
+
"category": "tasks_basic",
|
| 51 |
+
"tags": ["xTaskCreate", "stack"],
|
| 52 |
+
"difficulty": "intermediate",
|
| 53 |
+
"style": "code_lab",
|
| 54 |
+
"apis": ["xTaskCreate", "vTaskDelay"],
|
| 55 |
+
"esp_idf_version_note": "v5.x conceptual",
|
| 56 |
+
"source": "generated",
|
| 57 |
+
"multi_turn": false
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
- Every row has `system` plus at least one `user` / `assistant` pair.
|
| 63 |
+
- ~12% multi-turn (debug-style follow-ups).
|
| 64 |
+
- Categories cover tasks, SMP/pin-to-core, queues, semaphores/mutexes, event groups, FreeRTOS & ESP timers, stream/message buffers, notifications, ISR/critical sections, heap/`heap_caps`, ring buffers, hooks/TLS/WDT, design patterns, debug/troubleshoot, and compare/choose.
|
| 65 |
+
|
| 66 |
+
## Load
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
from datasets import load_dataset
|
| 70 |
+
|
| 71 |
+
ds = load_dataset("rafuke/freertos_esp32")
|
| 72 |
+
print(ds)
|
| 73 |
+
print(len(ds["train"]), len(ds["validation"]))
|
| 74 |
+
print(ds["train"][0]["messages"][0]["role"])
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
### Fine-tuning sketch (Unsloth + Qwen)
|
| 78 |
+
|
| 79 |
+
Map `messages` through the tokenizer chat template:
|
| 80 |
+
|
| 81 |
+
```python
|
| 82 |
+
from datasets import load_dataset
|
| 83 |
+
|
| 84 |
+
dataset = load_dataset("rafuke/freertos_esp32")
|
| 85 |
+
|
| 86 |
+
def to_text(batch, tokenizer):
|
| 87 |
+
texts = [
|
| 88 |
+
tokenizer.apply_chat_template(
|
| 89 |
+
msgs,
|
| 90 |
+
tokenize=False,
|
| 91 |
+
add_generation_prompt=False,
|
| 92 |
+
)
|
| 93 |
+
for msgs in batch["messages"]
|
| 94 |
+
]
|
| 95 |
+
return {"text": texts}
|
| 96 |
+
|
| 97 |
+
# train_ds = dataset["train"].map(lambda b: to_text(b, tokenizer), batched=True, ...)
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
## Intended use
|
| 101 |
+
|
| 102 |
+
- Supervised fine-tuning (SFT) of instruct models for ESP32 / FreeRTOS Q&A and code assistance.
|
| 103 |
+
- Evaluation of embedded RTOS knowledge in chat format.
|
| 104 |
+
|
| 105 |
+
## Out of scope / known limitations
|
| 106 |
+
|
| 107 |
+
- **Not a substitute for official docs.** Prefer Espressif ESP-IDF and FreeRTOS reference manuals for authoritative API contracts, errata, and chip-specific behavior.
|
| 108 |
+
- Answers target **ESP-IDF v5.x** conceptual usage; APIs and defaults can differ across IDF versions and SoCs (ESP32, S2, S3, C3, C6, H2, etc.).
|
| 109 |
+
- Vanilla FreeRTOS vs ESP-IDF FreeRTOS differences (SMP, pin-to-core, TWDT, `heap_caps`, ring buffers) are called out in spirit, but edge cases may be incomplete.
|
| 110 |
+
- Generated instructional content may contain occasional inaccuracies; validate critical code on hardware.
|
| 111 |
+
- Not a full project corpus (no complete `sdkconfig` / multi-file apps per row).
|
| 112 |
+
- English only.
|
| 113 |
+
|
| 114 |
+
## License
|
| 115 |
+
|
| 116 |
+
MIT — see `LICENSE` in this repository.
|
| 117 |
+
|
| 118 |
+
## Citation
|
| 119 |
+
|
| 120 |
+
If you use this dataset, please cite the Hub repo:
|
| 121 |
+
|
| 122 |
+
```
|
| 123 |
+
@misc{freertos_esp32,
|
| 124 |
+
title = {FreeRTOS ESP32},
|
| 125 |
+
author = {rafuke},
|
| 126 |
+
year = {2026},
|
| 127 |
+
url = {https://huggingface.co/datasets/rafuke/freertos_esp32}
|
| 128 |
+
}
|
| 129 |
+
```
|