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

Method get_dummy_inputs

diffusers/tests/lora/utils.py:180–199  ·  view source on GitHub ↗
(self, with_generator=True)

Source from the content-addressed store, hash-verified

178 raise NotImplementedError
179
180 def get_dummy_inputs(self, with_generator=True):
181 batch_size = 1
182 sequence_length = 10
183 num_channels = 4
184 sizes = (32, 32)
185
186 generator = torch.manual_seed(0)
187 noise = floats_tensor((batch_size, num_channels) + sizes)
188 input_ids = torch.randint(1, sequence_length, size=(batch_size, sequence_length), generator=generator)
189
190 pipeline_inputs = {
191 "prompt": "A painting of a squirrel eating a burger",
192 "num_inference_steps": 5,
193 "guidance_scale": 6.0,
194 "output_type": "np",
195 }
196 if with_generator:
197 pipeline_inputs.update({"generator": generator})
198
199 return noise, input_ids, pipeline_inputs
200
201 # Copied from: https://colab.research.google.com/gist/sayakpaul/df2ef6e1ae6d8c10a49d859883b10860/scratchpad.ipynb
202 def get_dummy_tokens(self):

Calls 2

floats_tensorFunction · 0.90
updateMethod · 0.45