


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	)					->       Dict:
      _lowercase											='''runwayml/stable-diffusion-v1-5'''
      _lowercase											=TextToVideoZeroPipeline.from_pretrained(UpperCAmelCase		,					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=UpperCAmelCase		,					generator=UpperCAmelCase	).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(UpperCAmelCase		,					UpperCAmelCase	)








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase__            =							{'''configuration_visual_bert''': ['''VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''VisualBertConfig''']}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__            =							[
      '''VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''VisualBertForMultipleChoice''',
      '''VisualBertForPreTraining''',
      '''VisualBertForQuestionAnswering''',
      '''VisualBertForRegionToPhraseAlignment''',
      '''VisualBertForVisualReasoning''',
      '''VisualBertLayer''',
      '''VisualBertModel''',
      '''VisualBertPreTrainedModel''',
  ]


if TYPE_CHECKING:
  from .configuration_visual_bert import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_visual_bert import (
        VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        VisualBertForMultipleChoice,
        VisualBertForPreTraining,
        VisualBertForQuestionAnswering,
        VisualBertForRegionToPhraseAlignment,
        VisualBertForVisualReasoning,
        VisualBertLayer,
        VisualBertModel,
        VisualBertPreTrainedModel,
    )


else:
  import sys

  UpperCAmelCase__            =							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

