noznarb commited on
Commit
885f6ab
1 Parent(s): 6b3fc80

Upload 4 files

Browse files
.gitattributes CHANGED
@@ -100,3 +100,4 @@ DansPileOfSets-Vicuna/test_merge_deduped-vicuna.json filter=lfs diff=lfs merge=l
100
  GPTeacher-Vicuna/Instruct/gpt4-instruct-dedupe-only-dataset-vicuna.json filter=lfs diff=lfs merge=lfs -text
101
  GPTeacher-Vicuna/Instruct/gpt4-instruct-vicuna-filtered-nounicode.json filter=lfs diff=lfs merge=lfs -text
102
  GPTeacher-Vicuna/Instruct/gpt4-instruct-vicuna-filtered.json filter=lfs diff=lfs merge=lfs -text
 
 
100
  GPTeacher-Vicuna/Instruct/gpt4-instruct-dedupe-only-dataset-vicuna.json filter=lfs diff=lfs merge=lfs -text
101
  GPTeacher-Vicuna/Instruct/gpt4-instruct-vicuna-filtered-nounicode.json filter=lfs diff=lfs merge=lfs -text
102
  GPTeacher-Vicuna/Instruct/gpt4-instruct-vicuna-filtered.json filter=lfs diff=lfs merge=lfs -text
103
+ SuperCOT-vicuna-dataset/filtered-vicuna-formatted.json filter=lfs diff=lfs merge=lfs -text
SuperCOT-vicuna-dataset/convert-to-vicuna.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const fs = require("fs");
2
+
3
+ let inputArray = JSON.parse(fs.readFileSync("filtered.json", "utf8"));
4
+
5
+ let destArray = [];
6
+
7
+ for (let i = 0; i < inputArray.length; i++)
8
+ {
9
+
10
+ let value = inputArray[i];
11
+
12
+ let destObj = {};
13
+ destObj.id = generateId();
14
+
15
+ destObj.conversations = [];
16
+ let conversation = {};
17
+
18
+ conversation.from = "human";
19
+ conversation.value = value.instruction + " " + value.input;
20
+
21
+ destObj.conversations.push(conversation);
22
+
23
+ conversation = {};
24
+
25
+ conversation.from = "gpt";
26
+ conversation.value = value.output;
27
+
28
+ destObj.conversations.push(conversation);
29
+
30
+ destArray.push(destObj);
31
+ }
32
+
33
+
34
+ fs.writeFileSync("output.json", JSON.stringify(destArray, null, 2), "utf8");
35
+
36
+ // This is just a best guess at ID formats based on the ShareGPT format
37
+ function generateId()
38
+ {
39
+ let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
40
+
41
+ let id = "";
42
+ for (let i = 0; i < 6; i++)
43
+ {
44
+ // Get a random index from the possible characters
45
+ let index = Math.floor(Math.random() * 62);
46
+ // Append the character at that index to the id string
47
+ id += chars[index];
48
+ }
49
+ //Append a random _XX to the id.
50
+ id += "_" + Math.floor(Math.random() * 100);
51
+
52
+ return id;
53
+ }
SuperCOT-vicuna-dataset/filtered-vicuna-formatted.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f23f8e2bd43a8966ab8e42b07f184a1b88e339b3d4325902bc44d93be05a70ec
3
+ size 43177271
SuperCOT-vicuna-dataset/merge_json.js ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const fs = require('fs');
2
+
3
+ function loadAndConcatJSON(files, callback)
4
+ {
5
+ let data = [];
6
+ for (let file of files)
7
+ {
8
+ data.push(require(file));
9
+ }
10
+
11
+ let output = [].concat(...data);
12
+ output = JSON.stringify(output);
13
+
14
+ fs.writeFile('output.json', output, err =>
15
+ {
16
+ if (err)
17
+ {
18
+ callback(err);
19
+ } else
20
+ {
21
+ callback(null, output);
22
+ }
23
+ });
24
+ }
25
+
26
+
27
+ loadAndConcatJSON(['./filtered-vicuna-formatted.json', './filtered.json'], (err, result) => {
28
+ if (err)
29
+ {
30
+ console.error(err);
31
+ }
32
+ else
33
+ {
34
+ console.log("Merged JSON files.");
35
+ }
36
+ });
SuperCOT-vicuna-dataset/validate.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const fs = require("fs");
2
+ try
3
+ {
4
+ let json = fs.readFileSync("ShareGPT_V4_unfiltered_cleaned_split.json", "utf8");
5
+ var obj = JSON.parse(json);
6
+ console.log("No problem");
7
+ }
8
+ catch (e) {
9
+ // The JSON was invalid, `e` has some further information
10
+ console.log(e);
11
+ }