MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / tokenize_prompt

Function tokenize_prompt

diffusers/examples/amused/train_amused.py:402–409  ·  view source on GitHub ↗
(tokenizer, prompt)

Source from the content-addressed store, hash-verified

400
401
402def tokenize_prompt(tokenizer, prompt):
403 return tokenizer(
404 prompt,
405 truncation=True,
406 padding="max_length",
407 max_length=77,
408 return_tensors="pt",
409 ).input_ids
410
411
412def encode_prompt(text_encoder, input_ids):

Callers 3

__getitem__Method · 0.70
__getitem__Method · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected