Any _working_ alternative to tf?
Universal Sentence Encoder 4: Complex model, especially for multi-epoch processing.
Try to use the lighter "Universal Sentence Encoder Lite" (https://www.tensorflow.org/hub/tutorials/semantic_similarity_with_tf_hub_universal_encoder_lite) for potential speed improvements.

Batch Processing: Instead of loading the entire file at once, process sentences in batches to reduce memory usage.
batch_size = 32  
embeddings = []
for i in range(0, len(lines), batch_size):
    batch_embeddings = use(lines[i:i+batch_size])
    embeddings.extend(batch_embeddings)

Remove the redundant with open(...) block as you're already reading the file using tf.io.read_file. Hi @deadjdona ,

You are using __call__ method on the model with epochs as one argument.Here `epochs` is not an accepted argument. Also the input i.e `l` should be a Vector i.e list. Could you please verify your input. Please refer attached [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/228197d31975ba304a7b51bd6067e73c/63090.ipynb) for a demo. Also please ensure latest version of TF with its compatible TF-Hub version. This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/63090">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/63090">No</a>
 > Hi @deadjdona ,
> 
> You are using **call** method on the model with epochs as one argument.Here `epochs` is not an accepted argument. Also the input i.e `l` should be a Vector i.e list. Could you please verify your input. Please refer attached [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/228197d31975ba304a7b51bd6067e73c/63090.ipynb) for a demo.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[<ipython-input-15-0874f4832b42>](https://localhost:8080/#) in <cell line: 1>()
----> 1 train_embeddings = use(l, epochs=2)
      2 train_embeddings

2 frames
[/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/function_type_utils.py](https://localhost:8080/#) in bind_function_inputs(args, kwargs, function_type, default_values)
    444     )
    445   except Exception as e:
--> 446     raise TypeError(
    447         f"Binding inputs to tf.function failed due to `{e}`. "
    448         f"Received args: {args} and kwargs: {sanitized_kwargs} for signature:"

TypeError: Binding inputs to tf.function failed due to `got an unexpected keyword argument 'epochs'`. Received args: (<tf.Tensor: shape=(), dtype=string, numpy=b'asdfbbbbsffnnc'>,) and kwargs: {'epochs': 2} for signature: (inputs: TensorSpec(shape=<unknown>, dtype=tf.string, name=None)).
### Issue type

Performance

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

binary

### TensorFlow version

2

### Custom code

No

### OS platform and distribution

Win 11

### Mobile device

_No response_

### Python version

3.11.8

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

![image](https://github.com/tensorflow/tensorflow/assets/3028308/69d53365-9fb7-4999-9bbe-5d394c0791e1)

expected it to actualy works **_🙄_**

### Standalone code to reproduce the issue

```shell
import tensorflow as tf
import tensorflow_hub as hub

module_url = "https://tfhub.dev/google/universal-sentence-encoder/4"
use = hub.load(module_url)
l = tf.io.read_file('yt2.txt')

# open and read yt2.txt file
with open("yt2.txt", "r") as f:
    contents = f.read()
lines = contents.splitlines()

train_embeddings = use(l, epochs=2)
```


### Relevant log output

```shell
12666m 00s
```
