MCPcopy Create free account
hub / github.com/FunAudioLLM/FunMusic / process_trans

Function process_trans

inspiremusic/utils/data_utils.py:91–104  ·  view source on GitHub ↗
(infile, outfile)

Source from the content-addressed store, hash-verified

89 f.close()
90
91def process_trans(infile, outfile):
92 trans = {}
93 with open(infile, "r") as f:
94 for line in f:
95 sec = line.strip().split("\t")
96 if len(sec) == 2:
97 trans[sec[0]] = sec[1]
98 else:
99 print(line)
100 f.close()
101 with open(outfile, 'w') as f:
102 for k, v in trans.items():
103 f.write("%s\t%s\n" %(k, rich_captions(v)))
104 f.close()

Callers

nothing calls this directly

Calls 2

rich_captionsFunction · 0.85
closeMethod · 0.80

Tested by

no test coverage detected