Closed RyanOvO closed 2 months ago
好的 后续更新一下
先提供一个json转jsonl的python脚本,后续完善文档。
import json
def json_array_to_jsonl(json_file_path, jsonl_file_path):
"""
将包含JSON数组的文件转换为JSONL格式。
参数:
- json_file_path: 输入的JSON文件路径
- jsonl_file_path: 输出的JSONL文件路径
"""
with open(json_file_path, 'r', encoding='utf-8') as json_file:
# 加载整个JSON数组
data = json.load(json_file)
with open(jsonl_file_path, 'w', encoding='utf-8') as jsonl_file:
# 遍历并写入JSONL文件
for obj in data:
jsonl_file.write(json.dumps(obj, ensure_ascii=False) + '\n')
# 使用示例
json_array_to_jsonl('aa.json', 'output2.jsonl')
先提供一个json转jsonl的python脚本,后续完善文档。
import json def json_array_to_jsonl(json_file_path, jsonl_file_path): """ 将包含JSON数组的文件转换为JSONL格式。 参数: - json_file_path: 输入的JSON文件路径 - jsonl_file_path: 输出的JSONL文件路径 """ with open(json_file_path, 'r', encoding='utf-8') as json_file: # 加载整个JSON数组 data = json.load(json_file) with open(jsonl_file_path, 'w', encoding='utf-8') as jsonl_file: # 遍历并写入JSONL文件 for obj in data: jsonl_file.write(json.dumps(obj, ensure_ascii=False) + '\n') # 使用示例 json_array_to_jsonl('aa.json', 'output2.jsonl')
好的,感谢。
[EmoLLM][InternLM2.5]EmoLLM V3.0 前瞻: 基于InternLM2.5-7B-Chat全量微调实践 - 知乎 https://zhuanlan.zhihu.com/p/708931911
可以参考这个文档
以及在open issue里爹系男友回复里看下
响应issue
可以放出 internlm2.5 微调训练时的 数据集文件列表以及是如何转成 jsonl 的么?