Request for Examples on Correct Use the CLIPText Model (transformers.CLIPTextModel)
From the documentation on the [Hugging Face Hub](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel), it is not clear:

1. How the CLIPTextModel can be used.
2. If it can be used to conduct Zero Shot Classification of textual inputs using a predefined list of tokens as classes.  To be precise, let us say I have a list dataset called x with two strings such that x = ["father holding a baby", "man at war"], and; a list of classes or image generation tokens; such that y = ["family time", "next generation weapons"]: Can I use the CLIPTextModel to class x using y?

In short, I am asking for an example on:

1. The correct usage of the CLIPTextModel.
2. The use-cases for the model.


I'm transferring this to transformers repo as this is more related to the docs there

cc @stevhliu <|||||>Hi,

The docs is actually correct, CLIPTextModel can be used to encode text into a vector representation (embedding).

```
from transformers import CLIPTokenizer, CLIPTextModel

model = CLIPTextModel.from_pretrained("openai/clip-vit-base-patch32")
tokenizer = CLIPTokenizer.from_pretrained("openai/clip-vit-base-patch32")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="pt")

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled (EOS token) states
````

So you have a set of texts (here "a photo of a cat" and "a photo of a dog") which you first prepare for the model using the tokenizer. Next, you forward them through CLIP's text encoder to get an embedding (here called "pooled output") out, which is of shape (batch_size, hidden_size), which in this case will be (2, 512).

That's all the CLIP text encoder does! Turn text into embedding vectors.

So no you can't use only the CLIP text encoder to perform zero-shot classification of images, for that you need both the image and text encoders (which is what `CLIPModel` is; it consists of both `CLIPTextModel` and `CLIPVisionModel`).