MedicalGPT 预训练环境搭建与训练完整工作日志
项目概述
本文档记录了在 RTX 5090 GPU 环境下搭建 MedicalGPT 预训练环境并成功完成训练的完整过程。项目基于 Qwen2.5-0.5B 模型,使用 LoRA (PEFT) 方法进行预训练。
环境信息
- 操作系统: Linux 5.15.0-94-generic
- GPU: NVIDIA GeForce RTX 5090
- Python
本文档记录了在 RTX 5090 GPU 环境下搭建 MedicalGPT 预训练环境并成功完成训练的完整过程。项目基于 Qwen2.5-0.5B 模型,使用 LoRA (PEFT) 方法进行预训练。
在 LLM Agent 训练中,有时存在需要通过代码行号进行补全的方法。
这个脚本给任意给定的代码行统一添加代码行号。
import json
import re
import argparse
def add_line_numbers_to_input(input_jsonl_path, output_jsonl_path):
with open(input_jsonl_path, 'r', encoding='utf-8') as fi... 在修复代码 bug 的 Agent check_list 策略中,一个基本的三步方法如下:
0(正确)和 1(错误)表示。1 的代... 工作中有清洗 jsonl 文件的需求,原因是 LLM 输出的内容有可能存在错误的补全,不能直接全部用于 Fine-tuning。
这个脚本清洗了 jsonl 文件中 input/output == "" 和 input 行重复 的情况。
import json
import random
input_file = 'file.jsonl'
output_file = 'file_cl...