Shadow0482 commited on
Commit
df98c44
·
verified ·
1 Parent(s): cb9bca3

Add Rust question/code dataset

Browse files
Files changed (2) hide show
  1. README.md +88 -0
  2. data/train-00000-of-00001.parquet +3 -0
README.md ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ task_categories:
4
+ - text-generation
5
+ language:
6
+ - en
7
+ tags:
8
+ - rust
9
+ - code
10
+ - instruction-tuning
11
+ - synthetic
12
+ size_categories:
13
+ - n<1K
14
+ configs:
15
+ - config_name: default
16
+ data_files:
17
+ - split: train
18
+ path: data/train-*.parquet
19
+ ---
20
+
21
+ # Rust code instruction dataset
22
+
23
+ 410 pairs of **(question, real Rust code)** built from 6 open-source GitHub repositories.
24
+
25
+ Each `answer` is original Rust source. Each `question` was written by `nvidia/nemotron-3.5-lightning-30b-a3b` from the code context; the model does not generate the answer.
26
+
27
+ ## Source repositories
28
+
29
+ | repository | commit | license | files | chunks | rows |
30
+ |---|---|---|---:|---:|---:|
31
+ | [TheAlgorithms/Rust](https://github.com/TheAlgorithms/Rust) | `fed66cb0c7` | MIT | 421 | 174 | 163 |
32
+ | [reyamira/models](https://github.com/reyamira/models) | `73997bf31e` | MIT | 78 | 29 | 23 |
33
+ | [AreevAI/flowcat](https://github.com/AreevAI/flowcat) | `9eb2999c33` | Apache-2.0 | 192 | 88 | 66 |
34
+ | [cortex/ripasso](https://github.com/cortex/ripasso) | `25f855dfc3` | GPL-3.0-only | 22 | 21 | 18 |
35
+ | [brentongunning/rust-sv](https://github.com/brentongunning/rust-sv) | `f2c9e939b3` | MIT | 54 | 22 | 21 |
36
+ | [lightningdevkit/rust-lightning](https://github.com/lightningdevkit/rust-lightning) | `48e8d4745e` | Apache-2.0 OR MIT | 257 | 138 | 119 |
37
+
38
+ ## Rows by kind
39
+
40
+ | kind | rows |
41
+ |---|---:|
42
+ | file | 410 |
43
+
44
+ ## Example
45
+
46
+ **Question**
47
+
48
+ > I need a Rust module that declares several backtracking algorithm submodules and re-exports their public functions. The module should define submodules named all_combination_of_size_k, graph_coloring, hamiltonian_cycle, knight_tour, n_queens, parentheses_generator, permutations, rat_in_maze, subset_sum, and sudoku. It must re-export exactly these functions with these exact names: generate_all_combinations, generate_colorings, find_hamiltonian_cycle, find_knight_tour, n_queens_solver, generate_parentheses, permute, find_path_in_maze, has_subset_with_sum, and sudoku_solver. Please generate the module declarations and pub use statements that match this structure.
49
+
50
+ **Answer** (`TheAlgorithms/Rust` - `src/backtracking/mod.rs`)
51
+
52
+ ```rust
53
+ mod all_combination_of_size_k;
54
+ mod graph_coloring;
55
+ mod hamiltonian_cycle;
56
+ mod knight_tour;
57
+ mod n_queens;
58
+ mod parentheses_generator;
59
+ mod permutations;
60
+ mod rat_in_maze;
61
+ mod subset_sum;
62
+ mod sudoku;
63
+
64
+ pub use all_combination_of_size_k::generate_all_combinations;
65
+ pub use graph_coloring::generate_colorings;
66
+ pub use hamiltonian_cycle::find_hamiltonian_cycle;
67
+ pub use knight_tour::find_knight_tour;
68
+ pub use n_queens::n_queens_solver;
69
+ pub use parentheses_generator::generate_parentheses;
70
+ pub use permutations::permute;
71
+ pub use rat_in_maze::find_path_in_maze;
72
+ pub use subset_sum::has_subset_with_sum;
73
+ pub use sudoku::sudoku_solver;
74
+ ```
75
+
76
+ ## Usage
77
+
78
+ ```python
79
+ from datasets import load_dataset
80
+
81
+ dataset = load_dataset("Shadow0482/rust", split="train")
82
+ print(dataset[0]["question"])
83
+ print(dataset[0]["answer"])
84
+ ```
85
+
86
+ ## License and attribution
87
+
88
+ Code in `answer` remains under the license of the source repository shown in the `license` and `repo_url` columns. Follow that license when redistributing or training on the data. The questions are synthetic; follow the terms of the model provider used to create them.
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b6b24755853348f86a6f4b97f73de59a5758fed8d136e9388ee4b93364e79a4
3
+ size 671747