-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename data process files and add together multiturn data preprocess
- Loading branch information
Showing
9 changed files
with
19 additions
and
711 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import json | ||
import os | ||
|
||
sotopia_data_dir = "/Users/pamela/Documents/capstone/sotopia-ft-data/GPT4-4_Redis_Easy_No_Filter" | ||
|
||
together_data_template = """<s>[INST] {user_msg} [/INST] {assistant_msg} </s>""" | ||
|
||
lines = [] | ||
for file in os.listdir(sotopia_data_dir): | ||
with open(os.path.join(sotopia_data_dir, file), 'r') as f: | ||
file_dict = json.load(f) | ||
text = together_data_template.format( | ||
user_msg=file_dict["prompt"], assistant_msg=file_dict["result"]) | ||
lines.append(text) | ||
|
||
with open("together-ft-gpt4-gpt4-easy-no-filter.jsonl", 'w') as f: | ||
for line in lines: | ||
f.write(json.dumps({"text": line})) | ||
f.write('\n') |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.