






"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowerCAmelCase     :     str            =	{"""configuration_qdqbert""": ["""QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """QDQBertConfig"""]}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _lowerCAmelCase     :     List[str]            =	[
     """QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """QDQBertForMaskedLM""",
     """QDQBertForMultipleChoice""",
     """QDQBertForNextSentencePrediction""",
     """QDQBertForQuestionAnswering""",
     """QDQBertForSequenceClassification""",
     """QDQBertForTokenClassification""",
     """QDQBertLayer""",
     """QDQBertLMHeadModel""",
     """QDQBertModel""",
     """QDQBertPreTrainedModel""",
     """load_tf_weights_in_qdqbert""",
 ]


if TYPE_CHECKING:
 from .configuration_qdqbert import QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, QDQBertConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_qdqbert import (
      QDQBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
      QDQBertForMaskedLM,
      QDQBertForMultipleChoice,
      QDQBertForNextSentencePrediction,
      QDQBertForQuestionAnswering,
      QDQBertForSequenceClassification,
      QDQBertForTokenClassification,
      QDQBertLayer,
      QDQBertLMHeadModel,
      QDQBertModel,
      QDQBertPreTrainedModel,
      load_tf_weights_in_qdqbert,
  )


else:
 import sys

 _lowerCAmelCase     :     Dict            =	_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)










"""simple docstring"""



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[Any]				):


        '''simple docstring'''
        UpperCAmelCase__		:  int				=				"runwayml/stable-diffusion-v1-5"
        UpperCAmelCase__		:  Optional[Any]				=				TextToVideoZeroPipeline.from_pretrained(snake_case__				,       torch_dtype=torch.floataa				).to("cuda"				)
        UpperCAmelCase__		:  Any				=				DDIMScheduler.from_config(pipe.scheduler.config				)
        UpperCAmelCase__		:  Optional[Any]				=				torch.Generator(device="cuda"				).manual_seed(0				)

        UpperCAmelCase__		:  Any				=				"A bear is playing a guitar on Times Square"
        UpperCAmelCase__		:  Dict				=				pipe(prompt=snake_case__				,       generator=snake_case__				).images

        UpperCAmelCase__		:  List[Any]				=				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(snake_case__				,       snake_case__				)


