





'''simple docstring'''







import unittest
import warnings
from dataclasses import dataclass

from transformers.convert_slow_tokenizer import SpmConverter
from transformers.testing_utils import get_tests_dir



@dataclass
class 							__SCREAMING_SNAKE_CASE			:
      '''simple docstring'''



      lowerCAmelCase__       :      str



class 							__SCREAMING_SNAKE_CASE			(       unittest.TestCase      ):
      '''simple docstring'''



      def   _lowerCamelCase		(							self    : int  )		->  List[str]:
           _lowercase							:      Tuple  						=							get_tests_dir('fixtures/test_sentencepiece.model'  )
           _lowercase							:      Optional[int]  						=							get_tests_dir('fixtures/test_sentencepiece_with_bytefallback.model'  )

           _lowercase							:      Optional[Any]  						=							FakeOriginalTokenizer(vocab_file=UpperCamelCase  )

           with warnings.catch_warnings(record=UpperCamelCase  ) as w:
                _lowercase							:      Union[str, Any]  						=							SpmConverter(UpperCamelCase  )
           self.assertEqual(len(UpperCamelCase  )   ,0  )

           _lowercase							:      str  						=							FakeOriginalTokenizer(vocab_file=UpperCamelCase  )

           with warnings.catch_warnings(record=UpperCamelCase  ) as w:
                _lowercase							:      Optional[int]  						=							SpmConverter(UpperCamelCase  )
           self.assertEqual(len(UpperCamelCase  )   ,1  )

           self.assertIn(
               'The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option'
               ' which is not implemented in the fast tokenizers.'   ,str(w[0].message  )   ,)









'''simple docstring'''







from dataclasses import dataclass
from typing import List, Optional, Union

import numpy as np
import PIL
from PIL import Image

from ...utils import BaseOutput, is_torch_available, is_transformers_available



@dataclass
# Copied from diffusers.pipelines.stable_diffusion.__init__.StableDiffusionPipelineOutput with Stable->Alt
class 							__SCREAMING_SNAKE_CASE			(       lowerCAmelCase__      ):
      '''simple docstring'''



      lowerCAmelCase__       :      Union[List[PIL.Image.Image], np.ndarray]
      lowerCAmelCase__       :      Optional[List[bool]]


if is_transformers_available() and is_torch_available():
    from .modeling_roberta_series import RobertaSeriesModelWithTransformation
    from .pipeline_alt_diffusion import AltDiffusionPipeline
    from .pipeline_alt_diffusion_imgaimg import AltDiffusionImgaImgPipeline