Skip to content

Clip Skip Setting when training #604

Answered by leppie
jsbach-jung asked this question in Q&A
Discussion options

You must be logged in to vote

Are the following statements true?

I believe both are true when training the text encoder.

Relevant code is here:

clip_skip = shared.opts.CLIP_stop_at_last_layers
if clip_skip <= 1:
encoder_hidden_states = text_encoder(input_ids)[0]
else:
enc_out = text_encoder(input_ids, output_hidden_states=True, return_dict=True)
encoder_hidden_states = enc_out['hidden_states'][-clip_skip]
encoder_hidden_states = text_encoder.text_model.final_layer_norm(encoder_hidden_states)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jsbach-jung
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants