add readme (#10)
* Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * remove submodule * add mPLUG MiniGPT4 * Update Readme.md * Update Readme.md * Update Readme.md --------- Co-authored-by: Yuliang Liu <34134635+Yuliang-Liu@users.noreply.github.com>
This commit is contained in:
20
models/MiniGPT4/dataset/convert_cc_sbu.py
Normal file
20
models/MiniGPT4/dataset/convert_cc_sbu.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import json
|
||||
import csv
|
||||
|
||||
# specify input and output file paths
|
||||
input_file = 'ccs_synthetic_filtered_large.json'
|
||||
output_file = 'ccs_synthetic_filtered_large.tsv'
|
||||
|
||||
# load JSON data from input file
|
||||
with open(input_file, 'r') as f:
|
||||
data = json.load(f)
|
||||
|
||||
# extract header and data from JSON
|
||||
header = data[0].keys()
|
||||
rows = [x.values() for x in data]
|
||||
|
||||
# write data to TSV file
|
||||
with open(output_file, 'w') as f:
|
||||
writer = csv.writer(f, delimiter='\t')
|
||||
writer.writerow(header)
|
||||
writer.writerows(rows)
|
Reference in New Issue
Block a user