IlyaGusev commited on
Commit
0b36015
1 Parent(s): 8a4931c

Initial commit

Browse files
.gitattributes CHANGED
@@ -53,3 +53,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
+ oasst2_ru_main_branch.jsonl filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ru
4
+ license: apache-2.0
5
+ size_categories:
6
+ - 1K<n<10K
7
+ task_categories:
8
+ - conversational
9
+ - text-generation
10
+ dataset_info:
11
+ features:
12
+ - name: messages
13
+ sequence:
14
+ - name: role
15
+ dtype: string
16
+ - name: content
17
+ dtype: string
18
+ - name: id
19
+ dtype: string
20
+ ---
21
+
22
+ * Based on [oasst2](https://huggingface.co/datasets/OpenAssistant/oasst2).
23
+ * Only Russian message trees, only main branches.
24
+ * Script: [get_oasst_ru.py](https://github.com/IlyaGusev/rulm/blob/master/self_instruct/src/data_processing/get_oasst_ru.py)
25
+
oasst2_ru_main_branch.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69eef03a8a50c7b4b08b75d504f15e5780300ad93733feb50952a357ead2e843
3
+ size 3687105
oasst2_ru_main_branch.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2023 The HuggingFace Datasets Authors and Ilya Gusev
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # Lint as: python3
17
+
18
+ import os
19
+ import io
20
+
21
+ import datasets
22
+
23
+ import json
24
+
25
+
26
+ _DESCRIPTION = "Russian main branches from oasst1"
27
+ _URL = "oasst1_ru_main_branch.jsonl"
28
+
29
+
30
+ class OASST2RuMainBranchDataset(datasets.GeneratorBasedBuilder):
31
+ VERSION = datasets.Version("0.0.1")
32
+
33
+ BUILDER_CONFIGS = [
34
+ datasets.BuilderConfig(name="default", version=VERSION, description=""),
35
+ ]
36
+
37
+ DEFAULT_CONFIG_NAME = "default"
38
+
39
+ def _info(self):
40
+ features = datasets.Features(
41
+ {
42
+ "messages": datasets.Sequence(feature={
43
+ "role": datasets.Value("string"),
44
+ "content": datasets.Value("string")
45
+ }),
46
+ "id": datasets.Value("string")
47
+ }
48
+ )
49
+ return datasets.DatasetInfo(
50
+ description=_DESCRIPTION,
51
+ features=features
52
+ )
53
+
54
+ def _split_generators(self, dl_manager):
55
+ downloaded_file = dl_manager.download(_URL)
56
+ return [
57
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"path": downloaded_file}),
58
+ ]
59
+
60
+ def _generate_examples(self, path):
61
+ with open(path, "r") as f:
62
+ for id_, line in enumerate(f):
63
+ item = json.loads(line)
64
+ yield id_, item