
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							)						->     Tuple:






								"""simple docstring"""



								UpperCAmelCase:					List[str] 						=     "runwayml/stable-diffusion-v1-5"
								UpperCAmelCase:					List[Any] 						=     TextToVideoZeroPipeline.from_pretrained(_SCREAMING_SNAKE_CASE	,				torch_dtype=torch.floataa							).to("cuda"							)
								UpperCAmelCase:					Tuple 						=     DDIMScheduler.from_config(pipe.scheduler.config							)
								UpperCAmelCase:					List[Any] 						=     torch.Generator(device="cuda"							).manual_seed(0							)

								UpperCAmelCase:					Any 						=     "A bear is playing a guitar on Times Square"
								UpperCAmelCase:					Tuple 						=     pipe(prompt=_SCREAMING_SNAKE_CASE	,				generator=_SCREAMING_SNAKE_CASE							).images

								UpperCAmelCase:					int 						=     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(_SCREAMING_SNAKE_CASE	,				_SCREAMING_SNAKE_CASE							)




def 			__SCREAMING_SNAKE_CASE		(		UpperCamelCase		:      str	)     ->	int:



	"""simple docstring"""






	a_     			=   len(UpperCamelCase	)
	a_     			=   [0] * length
	a_     			=   [[False for i in range(UpperCamelCase	)] for j in range(UpperCamelCase	)]
	for i, c in enumerate(UpperCamelCase	):
		a_     			=   i
		for j in range(i + 1	):
			if c == string[j] and (i - j < 2 or is_palindromic[j + 1][i - 1]):
				a_     			=   True
				a_     			=   min(UpperCamelCase     ,					0 if j == 0 else (cut[j - 1] + 1)	)
		a_     			=   mincut
	return cut[length - 1]


if __name__ == "__main__":
			_A							     =       input('Enter the string: ').strip()
			_A							     =       find_minimum_partitions(s)
			print(f'Minimum number of partitions required for the \'{s}\' is {ans}')