Upload 4 files
Browse files
.gitattributes
CHANGED
@@ -101,3 +101,4 @@ GPTeacher-Vicuna/Instruct/gpt4-instruct-dedupe-only-dataset-vicuna.json filter=l
|
|
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
|
|
|
|
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
|
104 |
+
Vicuna_Evol_Instruct_Cleaned/wizard_cleaned_vicuna.json filter=lfs diff=lfs merge=lfs -text
|
Vicuna_Evol_Instruct_Cleaned/convert-to-vicuna.js
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const fs = require("fs");
|
2 |
+
|
3 |
+
let inputArray = JSON.parse(fs.readFileSync("wizard_cleaned_scrubbed_deduped_urlsremoved.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 |
+
}
|
Vicuna_Evol_Instruct_Cleaned/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 |
+
});
|
Vicuna_Evol_Instruct_Cleaned/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 |
+
}
|
Vicuna_Evol_Instruct_Cleaned/wizard_cleaned_vicuna.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e4c2bef9fd4f2edec80b1327a9cd8b00500a406a04e6b604fbd56c752181565
|
3 |
+
size 93633254
|