Update convert_to_sharegpt.py
Browse files- convert_to_sharegpt.py +6 -1
convert_to_sharegpt.py
CHANGED
|
@@ -85,7 +85,12 @@ def main(args):
|
|
| 85 |
)
|
| 86 |
|
| 87 |
df = processed.to_pandas()
|
| 88 |
-
df.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
|
| 91 |
if __name__ == "__main__":
|
|
|
|
| 85 |
)
|
| 86 |
|
| 87 |
df = processed.to_pandas()
|
| 88 |
+
data = df.to_dict('records')
|
| 89 |
+
for item in data:
|
| 90 |
+
item["images"] = item["images"].tolist()
|
| 91 |
+
item["conversations"] = item["conversations"].tolist()
|
| 92 |
+
with open(args.output, 'w', encoding='utf-8') as f:
|
| 93 |
+
json.dump(data, f, ensure_ascii=False, indent=2)
|
| 94 |
|
| 95 |
|
| 96 |
if __name__ == "__main__":
|