






"""simple docstring"""






import pytest


UpperCAmelCase_   : Union[str, Any]   			= """__dummy_dataset1__"""

UpperCAmelCase_   : Optional[int]   			= """
import json
import os

import datasets


REPO_URL = \"https://huggingface.co/datasets/albertvillanova/tests-raw-jsonl/resolve/main/\"
URLS = {\"train\": REPO_URL + \"wikiann-bn-train.jsonl\", \"validation\": REPO_URL + \"wikiann-bn-validation.jsonl\"}


class __DummyDataset1__(datasets.GeneratorBasedBuilder):

    def _info(self):
        features = datasets.Features(
            {
                \"tokens\": datasets.Sequence(datasets.Value(\"string\")),
                \"ner_tags\": datasets.Sequence(
                    datasets.features.ClassLabel(
                        names=[
                            \"O\",
                            \"B-PER\",
                            \"I-PER\",
                            \"B-ORG\",
                            \"I-ORG\",
                            \"B-LOC\",
                            \"I-LOC\",
                        ]
                    )
                ),
                \"langs\": datasets.Sequence(datasets.Value(\"string\")),
                \"spans\": datasets.Sequence(datasets.Value(\"string\")),
            }
        )
        return datasets.DatasetInfo(features=features)

    def _split_generators(self, dl_manager):
        dl_path = dl_manager.download(URLS)
        return [
            datasets.SplitGenerator(datasets.Split.TRAIN, gen_kwargs={\"filepath\": dl_path[\"train\"]}),
            datasets.SplitGenerator(datasets.Split.VALIDATION, gen_kwargs={\"filepath\": dl_path[\"validation\"]}),
        ]

    def _generate_examples(self, filepath):
        with open(filepath, \"r\", encoding=\"utf-8\") as f:
            for i, line in enumerate(f):
                yield i, json.loads(line)
"""



@pytest.fixture
def 					_A			() ->       List[Any]:
    """simple docstring"""






    return DATASET_LOADING_SCRIPT_NAME



@pytest.fixture
def 					_A			() ->       str:
    """simple docstring"""






    return DATASET_LOADING_SCRIPT_CODE





@pytest.fixture
def 					_A			(__a    ,				__a    ,				__a							) ->       Optional[int]:
    """simple docstring"""






    SCREAMING_SNAKE_CASE_      :  int    						=		dataset_loading_script_name
    SCREAMING_SNAKE_CASE_      :  int    						=		tmp_path / '''datasets''' / script_name
    script_dir.mkdir(parents=__a							)
    SCREAMING_SNAKE_CASE_      :  Any    						=		script_dir / f'{script_name}.py'
    with open(__a    ,				'''w'''							) as f:
        f.write(__a							)
    return str(__a							)










"""simple docstring"""






import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible




class 							lowerCAmelCase__				(			unittest.TestCase ):






      '''simple docstring'''

      def _SCREAMING_SNAKE_CASE (						self     :  str):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  Optional[Any]    						=		[
              '''safety_checker/pytorch_model.bin''',
              '''safety_checker/model.safetensors''',
              '''vae/diffusion_pytorch_model.bin''',
              '''vae/diffusion_pytorch_model.safetensors''',
              '''text_encoder/pytorch_model.bin''',
              '''text_encoder/model.safetensors''',
              '''unet/diffusion_pytorch_model.bin''',
              '''unet/diffusion_pytorch_model.safetensors''',
          ]
          self.assertTrue(is_safetensors_compatible(lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  Optional[int]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  Optional[Any]    						=		[
              '''unet/diffusion_pytorch_model.bin''',
              '''unet/diffusion_pytorch_model.safetensors''',
          ]
          self.assertTrue(is_safetensors_compatible(lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  List[str]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  Optional[int]    						=		[
              '''safety_checker/pytorch_model.bin''',
              '''safety_checker/model.safetensors''',
              '''vae/diffusion_pytorch_model.bin''',
              '''vae/diffusion_pytorch_model.safetensors''',
              '''text_encoder/pytorch_model.bin''',
              '''text_encoder/model.safetensors''',
              '''unet/diffusion_pytorch_model.bin''',
              # Removed: 'unet/diffusion_pytorch_model.safetensors',
          ]
          self.assertFalse(is_safetensors_compatible(lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  int):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  List[Any]    						=		[
              '''text_encoder/pytorch_model.bin''',
              '''text_encoder/model.safetensors''',
          ]
          self.assertTrue(is_safetensors_compatible(lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  Optional[int]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  Optional[int]    						=		[
              '''safety_checker/pytorch_model.bin''',
              '''safety_checker/model.safetensors''',
              '''vae/diffusion_pytorch_model.bin''',
              '''vae/diffusion_pytorch_model.safetensors''',
              '''text_encoder/pytorch_model.bin''',
              # Removed: 'text_encoder/model.safetensors',
              '''unet/diffusion_pytorch_model.bin''',
              '''unet/diffusion_pytorch_model.safetensors''',
          ]
          self.assertFalse(is_safetensors_compatible(lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  List[Any]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  str    						=		[
              '''safety_checker/pytorch_model.fp16.bin''',
              '''safety_checker/model.fp16.safetensors''',
              '''vae/diffusion_pytorch_model.fp16.bin''',
              '''vae/diffusion_pytorch_model.fp16.safetensors''',
              '''text_encoder/pytorch_model.fp16.bin''',
              '''text_encoder/model.fp16.safetensors''',
              '''unet/diffusion_pytorch_model.fp16.bin''',
              '''unet/diffusion_pytorch_model.fp16.safetensors''',
          ]
          SCREAMING_SNAKE_CASE_      :  Any    						=		'''fp16'''
          self.assertTrue(is_safetensors_compatible(lowercase_						,	variant=lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  str):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  Optional[int]    						=		[
              '''unet/diffusion_pytorch_model.fp16.bin''',
              '''unet/diffusion_pytorch_model.fp16.safetensors''',
          ]
          SCREAMING_SNAKE_CASE_      :  Dict    						=		'''fp16'''
          self.assertTrue(is_safetensors_compatible(lowercase_						,	variant=lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  int):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  List[str]    						=		[
              '''unet/diffusion_pytorch_model.bin''',
              '''unet/diffusion_pytorch_model.safetensors''',
          ]
          SCREAMING_SNAKE_CASE_      :  Any    						=		'''fp16'''
          self.assertTrue(is_safetensors_compatible(lowercase_						,	variant=lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  Union[str, Any]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  Tuple    						=		[
              '''safety_checker/pytorch_model.fp16.bin''',
              '''safety_checker/model.fp16.safetensors''',
              '''vae/diffusion_pytorch_model.fp16.bin''',
              '''vae/diffusion_pytorch_model.fp16.safetensors''',
              '''text_encoder/pytorch_model.fp16.bin''',
              '''text_encoder/model.fp16.safetensors''',
              '''unet/diffusion_pytorch_model.fp16.bin''',
              # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
          ]
          SCREAMING_SNAKE_CASE_      :  List[Any]    						=		'''fp16'''
          self.assertFalse(is_safetensors_compatible(lowercase_						,	variant=lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  List[Any]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  List[Any]    						=		[
              '''text_encoder/pytorch_model.fp16.bin''',
              '''text_encoder/model.fp16.safetensors''',
          ]
          SCREAMING_SNAKE_CASE_      :  Any    						=		'''fp16'''
          self.assertTrue(is_safetensors_compatible(lowercase_						,	variant=lowercase_))
      def _SCREAMING_SNAKE_CASE (						self     :  List[str]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  Optional[Any]    						=		[
              '''text_encoder/pytorch_model.bin''',
              '''text_encoder/model.safetensors''',
          ]
          SCREAMING_SNAKE_CASE_      :  List[Any]    						=		'''fp16'''
          self.assertTrue(is_safetensors_compatible(lowercase_						,	variant=lowercase_))



      def _SCREAMING_SNAKE_CASE (						self     :  Optional[Any]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  Optional[int]    						=		[
              '''safety_checker/pytorch_model.fp16.bin''',
              '''safety_checker/model.fp16.safetensors''',
              '''vae/diffusion_pytorch_model.fp16.bin''',
              '''vae/diffusion_pytorch_model.fp16.safetensors''',
              '''text_encoder/pytorch_model.fp16.bin''',
              # 'text_encoder/model.fp16.safetensors',
              '''unet/diffusion_pytorch_model.fp16.bin''',
              '''unet/diffusion_pytorch_model.fp16.safetensors''',
          ]
          SCREAMING_SNAKE_CASE_      :  str    						=		'''fp16'''
          self.assertFalse(is_safetensors_compatible(lowercase_						,	variant=lowercase_))


