I want to save the embeddings generated by Universal Sentence Encoder as .txt files. When I run the following code I get this error- TypeError: write() argument must be str, not tensorflow.python.framework.ops.EagerTensor
embeddings = USE_model(text[0:100])
txtfile = file_path + '/embedding' + '.txt'
if not os.path.exists(txtfile):
text_file = open(txtfile, "a")
text_file.write(embeddings)
text_file.close()
What's the best way to convert tensorflow.python.framework.ops.EagerTensor to text?