evalmerge / domainnet /test_split.py
yashkant's picture
Upload domainnet/test_split.py with huggingface_hub
1ead5e3 verified
import random
domains = ["clipart", "infograph", "painting", "quickdraw", "real", "sketch"]
random.seed(42)
for domain in domains:
with open(domain + '_test.txt', 'r') as f:
domain_data = f.readlines()
random.shuffle(domain_data)
with open(domain + '_test_fold.txt', 'w') as f:
f.write("".join(domain_data))