I got the error: google.api_core.exceptions.InvalidArgument: 400 Request is too large: 20000 total tokens allowed in a request, 89731 received, and my code looks like below:
model = TextEmbeddingModel.from_pretrained("textembedding-gecko@003")
text_embedding_input = TextEmbeddingInput(
task_type="CLUSTERING", text=some_long_text)
embeddings = model.get_embeddings([text_embedding_input])
https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#generative-ai-g...
Here it says "Each input text has a token limit of 3,072. Inputs longer than this length are silently truncated. You can also disable silent truncation by setting autoTruncate to false." I didn't set autoTruncate to false, and I also didn't find a place to explicitly set it to true. Why is my input not truncated automatically? And how should I truncate it to within the limit? Thanks!
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |