


import unittest

import torch

from diffusers import DDIMScheduler, TextToVideoZeroPipeline
from diffusers.utils import load_pt, require_torch_gpu, slow

from ..test_pipelines_common import assert_mean_pixel_difference







@slow
@require_torch_gpu
class  lowerCamelCase__  (			unittest.TestCase):





     def 	__A   (self			)	->  Optional[int]:
      _lowercase				 ='runwayml/stable-diffusion-v1-5'
      _lowercase				 =TextToVideoZeroPipeline.from_pretrained(lowercase_						,	torch_dtype=torch.floataa			).to('''cuda'''			)
      _lowercase				 =DDIMScheduler.from_config(pipe.scheduler.config			)
      _lowercase				 =torch.Generator(device='''cuda'''			).manual_seed(0			)

      _lowercase				 ='A bear is playing a guitar on Times Square'
      _lowercase				 =pipe(prompt=lowercase_						,	generator=lowercase_			).images

      _lowercase				 =load_pt(
          '''https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/text-to-video/A bear is playing a guitar on Times Square.pt'''			)

      assert_mean_pixel_difference(lowercase_						,	lowercase_			)









"""simple docstring"""


def 					a			(  UpperCamelCase_				:					float		)	->		int:
 return int(UpperCamelCase_		) if x - int(UpperCamelCase_		) <= 0 else int(UpperCamelCase_		) + 1


if __name__ == "__main__":
   import doctest

   doctest.testmod()





