freertos_esp32 / README.md
rafuke's picture
Upload README.md with huggingface_hub
a2f0291 verified
|
Raw
History Blame Contribute Delete
3.79 kB
---
license: mit
task_categories:
- text-generation
language:
- en
tags:
- freertos
- esp32
- esp-idf
- qwen
- unsloth
- code
pretty_name: FreeRTOS ESP32
size_categories:
- 1K<n<10K
---
# FreeRTOS ESP32
Instructional **ChatML** dataset for fine-tuning language models (e.g. **Qwen** via **Unsloth**) as an expert **ESP32 / ESP-IDF / FreeRTOS** assistant.
Content is original instructional material oriented around ESP-IDF v5.x FreeRTOS APIs and idioms — not a verbatim dump of vendor documentation.
## Dataset summary
| Item | Value |
|------|--------|
| Format | Hub `Dataset` / JSONL with ChatML `messages` (`system` / `user` / `assistant`) |
| Total examples | **1160** |
| Train | **1101** |
| Validation | **59** (~5%, stratified by category) |
| License | MIT |
| Language | English |
| Focus | FreeRTOS on ESP32 (ESP-IDF), embedded C, real-time patterns |
Each row has a `messages` list (ChatML) and a `meta` object (id, category, tags, difficulty, style, APIs, etc.).
### Schema
```json
{
"messages": [
{"role": "system", "content": "..."},
{"role": "user", "content": "..."},
{"role": "assistant", "content": "..."}
],
"meta": {
"id": "tasks_basic_0042",
"category": "tasks_basic",
"tags": ["xTaskCreate", "stack"],
"difficulty": "intermediate",
"style": "code_lab",
"apis": ["xTaskCreate", "vTaskDelay"],
"esp_idf_version_note": "v5.x conceptual",
"source": "generated",
"multi_turn": false
}
}
```
- Every row has `system` plus at least one `user` / `assistant` pair.
- ~12% multi-turn (debug-style follow-ups).
- 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.
## Load
```python
from datasets import load_dataset
ds = load_dataset("rafuke/freertos_esp32")
print(ds)
print(len(ds["train"]), len(ds["validation"]))
print(ds["train"][0]["messages"][0]["role"])
```
### Fine-tuning sketch (Unsloth + Qwen)
Map `messages` through the tokenizer chat template:
```python
from datasets import load_dataset
dataset = load_dataset("rafuke/freertos_esp32")
def to_text(batch, tokenizer):
texts = [
tokenizer.apply_chat_template(
msgs,
tokenize=False,
add_generation_prompt=False,
)
for msgs in batch["messages"]
]
return {"text": texts}
# train_ds = dataset["train"].map(lambda b: to_text(b, tokenizer), batched=True, ...)
```
## Intended use
- Supervised fine-tuning (SFT) of instruct models for ESP32 / FreeRTOS Q&A and code assistance.
- Evaluation of embedded RTOS knowledge in chat format.
## Out of scope / known limitations
- **Not a substitute for official docs.** Prefer Espressif ESP-IDF and FreeRTOS reference manuals for authoritative API contracts, errata, and chip-specific behavior.
- 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.).
- 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.
- Generated instructional content may contain occasional inaccuracies; validate critical code on hardware.
- Not a full project corpus (no complete `sdkconfig` / multi-file apps per row).
- English only.
## License
MIT — see `LICENSE` in this repository.
## Citation
If you use this dataset, please cite the Hub repo:
```
@misc{freertos_esp32,
title = {FreeRTOS ESP32},
author = {rafuke},
year = {2026},
url = {https://huggingface.co/datasets/rafuke/freertos_esp32}
}
```