Open sswwjj4 opened 1 year ago
验证集是空的,从训练集剪切前五条放到验证集
#@title 生成验证集文件列表
import random
def cut_and_paste(train_file_path, eval_file_path):
with open(train_file_path, 'r') as f:
lines = f.readlines()
random_lines = random.sample(lines, 5)
with open(eval_file_path, 'w') as f:
f.write('')
with open(eval_file_path, 'a') as f:
for line in random_lines:
f.write(line)
cut_and_paste('/content/lora-svc/filelists/train.txt', '/content/lora-svc/filelists/eval.txt')
可以参考下colab