AttributeError: 'NoneType' object has no attribute 'tokenize'
So i’m getting this error (AttributeError: ‘NoneType’ object has no attribute ‘tokenize’) with some models, any direction towards solving this problem will be appreciated, ty. Here is my code below#@title#InstallDependenciesInstall the required files and import modules!pip install -q --upgrade huggingface_hub!pip install -q diffusers==0.25.0 accelerate omegaconf xformers transformers gradio mediapy scipy ftfy torchsde k-diffusion fastapi==0.103.2import mediapy as mediaimport randomimport sysimport torchimport osfrom diffusers import DiffusionPipelinefrom diffusers.models.attention_processor import AttnProcessor2_0from diffusers import StableDiffusionXLPipeline, AutoencoderKL, DPMSolverMultistepSchedulerfrom IPython.display import clear_outputfrom diffusers import StableDiffusionKDiffusionPipelineclear_output()#@title#Download& Load ModelLoad model from diffusersmodel = “digiplay/RealEpicMajicRevolution_v1” #@param[“digiplay/Realisian_v5”, “SG161222/Realistic_Vision_V6.0_B1_noVAE”, “segmind/SSD-1B”, “digiplay/RealEpicMajicRevolution_v1”, “imagepipeline/Realities-Edge-XL”, “stablediffusionapi/realisian111”] {type:“string”}pipe = StableDiffusionXLPipeline.from_pretrained(model,torch_dtype=torch.float16,variant=“fp16”,use_safetensors=True,requires_safety_checker=None,)pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, use_karras_sigmas=True, algorithm_type=“dpmsolver++”)Load it to GPUpipe = pipe.to(‘cuda’)#@title#DiffusersUIDefine every compunentprompt = “cute dog playing in field” #@param{type:“string”}negative_prompt = “bad anatomy, bad face details, low quality, unrealistic, 3d, anime” #@param{type:“string”}num_inference_steps = 20 #@param{type:“slider”, def:10, min:1, max:100}selected_resolution = 400, 700 #@param[“1600, 900”,“1280, 720”,“700, 400”,“500, 200”,“200, 500”,“400, 700”,“720, 1280”,“900, 1600”,“512, 512”,“768, 768”,“1024, 1024” ] {type:“raw”}guidance_scale = 5 #@param{type:“slider”, def:5, min:0, max:10}seed_input = “1735499402575024878” #@param{type: “string”}requires_safety_checker = Nonepipe.safety_checker = NoneSeed randomizer functionif seed_input == “”:seed = random.randint(0, sys.maxsize)else:try:seed = int(seed_input)except ValueError:print(“Invalid input. Please enter a valid number.”)seed = Noneprint(“Seed:”, seed)Optimizationspipe.enable_xformers_memory_efficient_attention()Image generation functionimages = pipe(prompt = prompt,negative_prompt = negative_prompt,guidance_scale = guidance_scale,num_inference_steps = num_inference_steps,width = selected_resolution[0] - selected_resolution[0] % 8,height = selected_resolution[1] - selected_resolution[1] % 8,use_karras_sigmas=True,generator = torch.Generator(“cuda”).manual_seed(seed),).imagesShow imagemedia.show_images(images)images[0].save(“output.jpg”)And My Diffusers Env is belowdiffusersversion: 0.25.0Platform: Linux-6.1.58±x86_64-with-glibc2.35Python version: 3.10.12PyTorch version (GPU?): 2.1.2+cu121 (True)Huggingface_hub version: 0.20.2Transformers version: 4.35.2Accelerate version: 0.25.0xFormers version: 0.0.23.post1Using GPU in script?: YESUsing distributed or parallel set-up in script?: