File size: 4,206 Bytes
d2cae38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---

language:
- ru
- en
license: apache-2.0
task_categories:
- text-generation
tags:
- code
- python
- synthetic
- compiler-verified
- instruction-tuning
- unsloth
size_categories:
- n<1K
---


# 🤖 Stray Python Verified Dataset

[English](#english) | [Русский](#русский)

---

## English

### Overview
**Stray Python Verified** is a high-purity synthetic dataset designed for instruction-tuning and fine-tuning lightweight code LLMs (e.g., Qwen 2.5 Coder 0.5B/1.5B/3B, Gemma 2/3, Llama 3.2). 

Each sample in this dataset was generated using a **Dual-AI pipeline** and subjected to a strict **3-stage automated compiler and sandbox verification** before being accepted:
1. **AST Parsing (`ast.parse`)**: Verifies syntactic accuracy and structural integrity.
2. **Bytecode Compilation (`compile`)**: Validates CPython bytecode generation.
3. **Execution Sandbox (`subprocess.run`)**: Verifies runtime behavior and filters out hanging loops (`timeout > 3s`) and runtime exceptions.

### Dataset Format
The dataset is formatted in standard **ChatML (`messages`)** format:
```json

{

  "messages": [

    {"role": "system", "content": "Ты опытный Python разработчик..."},

    {"role": "user", "content": "<Task condition>"},

    {"role": "assistant", "content": "```python\n<Verified Code>\n```"}

  ]

}

```

### ⚠️ Disclaimer & Limitations
* This dataset was **synthetically generated by AI models** and filtered automatically through code compilers and execution sandboxes.
* While the code is guaranteed to be syntactically valid and non-crashing in basic environments, **some subtle logical oversights, edge-case limitations, or imperfect implementations may still be present**. 
* Intended primarily for research, distillation, and fine-tuning experiments.

---

## Русский

### Описание
**Stray Python Verified** — это очищенный синтетический датасет для дообучения (SFT / LoRA) компактных языковых моделей по программированию на Python (Qwen 2.5 Coder, Gemma, Llama).

Каждый пример создан двух-агентной фабрикой (**Dual-AI**) и прошёл автоматический **3-ступенчатый фильтр компилятора и рантайм-песочницы**:
1. **AST-валидация**: отсекает синтаксические ошибки, кривые отступы и незакрытые скобки.
2. **Компиляция байткода**: гарантирует корректность внутренней структуры Python C-байткода.
3. **Изолированный запуск**: отлавливает зависающие циклы (`timeout > 3s`) и рантайм-падения.

### Формат данных
Данные упакованы в стандартный формат **ChatML (`messages`)**, полностью готовый для обучения через **Unsloth, TRL, SFTTrainer** и Hugging Face:
* `system`: инструкция для роли разработчика.
* `user`: условие задачи по Python.
* `assistant`: протестированный рабочий блок кода.

### ⚠️ Предупреждение и ограничения
* Датасет **сгенерирован искусственным интеллектом** и проверен компилятором.
* Несмотря на автоматическую проверку синтаксиса и выполнения, **в коде могут присутствовать логические недочёты, шероховатости или неоптимальные краевые случаи**.
* Создан для исследовательских целей, экспериментов по дистилляции знаний и дообучению легковесных моделей.

---
**Author / Создатель:** [Stray2024](https://huggingface.co/Stray2024)
**Current Samples / Всего сэмплов:** 187