I'd like to export the list of sequences obtained in this program to a txt file. How can I do that?
with open("example_val.txt") as f:
sequence = []
for line in f:
if line.startswith(""):
line = line[:-1]
seq = (line.split("<|endoftext|>")[1].split(':')[0] + ":")
output.write(seq)
sequence.append(seq)
print(seq)
output:
ERRDLLRFKH:
RRDLLRFKHG:
RDLLRFKHGD:
DLLRFKHGDS:
LLRFKHGDSE:
LSPATRWGMI: