Skip to content

About the alignernet training data form #2

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

Open
srymaker opened this issue May 13, 2024 · 1 comment
Open

About the alignernet training data form #2

srymaker opened this issue May 13, 2024 · 1 comment

Comments

@srymaker
Copy link

Thank you for your great work!
I wanna know about the align training stage’s data form. Specifically, the data format loaded by laion2b_loader in the code and how to build it.

@xichenpan
Copy link
Owner

Hi I should be like

json_content = [
{
"source": [],
"source_lang": "instructpix2pix",
"weight": 1.0,
"name": "instructpix2pix",
}
]
# find all tsv files in the output directory, save name to json file
for file in os.listdir(os.path.join(args.output_dir, 'data')):
if file.endswith('.tsv'):
json_content[0]['source'].append(file)
# save json file
with open(os.path.join(args.output_dir, 'json', 'train.json'), 'w', encoding='utf-8') as f:
json.dump(json_content, f, indent=4)

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

2 participants