(Go: >> BACK << -|- >> HOME <<)

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

训练一切正常,但是保存第一个模型时出现了ZeroDivisionError: float division by zero #60

Open
sswwjj4 opened this issue May 10, 2023 · 2 comments

Comments

@sswwjj4
Copy link
sswwjj4 commented May 10, 2023
屏幕截图 2023-05-10 081846
@MaxMax2016
Copy link
Collaborator

验证集是空的,从训练集剪切前五条放到验证集

@KakaruHayate
Copy link
Contributor
屏幕截图 2023-05-10 081846
#@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants