






'''simple docstring'''







import argparse
import json
from pathlib import Path

import requests
import torch
from huggingface_hub import cached_download, hf_hub_url
from PIL import Image

from transformers import DPTConfig, DPTForDepthEstimation, DPTForSemanticSegmentation, DPTImageProcessor
from transformers.utils import logging


logging.set_verbosity_info()
UpperCamelCase    :      Optional[int]  			=		logging.get_logger(__name__)
def 						A__			(				__lowerCAmelCase		:			str						):
						lowerCamelCase__         =  DPTConfig()

						if "large" in checkpoint_url:
												lowerCamelCase__         =  1024
												lowerCamelCase__         =  4096
												lowerCamelCase__         =  24
												lowerCamelCase__         =  16
												lowerCamelCase__         =  [5, 11, 17, 23]
												lowerCamelCase__         =  [256, 512, 1024, 1024]
												lowerCamelCase__         =  (1, 384, 384)

						if "ade" in checkpoint_url:
												lowerCamelCase__         =  True

												lowerCamelCase__         =  150
												lowerCamelCase__         =  """huggingface/label-files"""
												lowerCamelCase__         =  """ade20k-id2label.json"""
												lowerCamelCase__         =  json.load(open(cached_download(hf_hub_url(__lowerCAmelCase   ,    __lowerCAmelCase   ,    repo_type="""dataset"""						)						)   ,    """r"""						)						)
												lowerCamelCase__         =  {int(__lowerCAmelCase						): v for k, v in idalabel.items()}
												lowerCamelCase__         =  idalabel
												lowerCamelCase__         =  {v: k for k, v in idalabel.items()}
												lowerCamelCase__         =  [1, 150, 480, 480]

						return config, expected_shape
def 						A__			(				__lowerCAmelCase		:			Tuple						):
						lowerCamelCase__         =  ["""pretrained.model.head.weight""", """pretrained.model.head.bias"""]
						for k in ignore_keys:
												state_dict.pop(__lowerCAmelCase   ,    __lowerCAmelCase						)
def 						A__			(				__lowerCAmelCase		:			Dict						):
						if (
						    "pretrained.model" in name
						    and "cls_token" not in name
						    and "pos_embed" not in name
						    and "patch_embed" not in name
						):
												lowerCamelCase__         =  name.replace("""pretrained.model"""   ,    """dpt.encoder"""						)
						if "pretrained.model" in name:
												lowerCamelCase__         =  name.replace("""pretrained.model"""   ,    """dpt.embeddings"""						)
						if "patch_embed" in name:
												lowerCamelCase__         =  name.replace("""patch_embed"""   ,    """patch_embeddings"""						)
						if "pos_embed" in name:
												lowerCamelCase__         =  name.replace("""pos_embed"""   ,    """position_embeddings"""						)
						if "attn.proj" in name:
												lowerCamelCase__         =  name.replace("""attn.proj"""   ,    """attention.output.dense"""						)
						if "proj" in name and "project" not in name:
												lowerCamelCase__         =  name.replace("""proj"""   ,    """projection"""						)
						if "blocks" in name:
												lowerCamelCase__         =  name.replace("""blocks"""   ,    """layer"""						)
						if "mlp.fc1" in name:
												lowerCamelCase__         =  name.replace("""mlp.fc1"""   ,    """intermediate.dense"""						)
						if "mlp.fc2" in name:
												lowerCamelCase__         =  name.replace("""mlp.fc2"""   ,    """output.dense"""						)
						if "norm1" in name:
												lowerCamelCase__         =  name.replace("""norm1"""   ,    """layernorm_before"""						)
						if "norm2" in name:
												lowerCamelCase__         =  name.replace("""norm2"""   ,    """layernorm_after"""						)
						if "scratch.output_conv" in name:
												lowerCamelCase__         =  name.replace("""scratch.output_conv"""   ,    """head"""						)
						if "scratch" in name:
												lowerCamelCase__         =  name.replace("""scratch"""   ,    """neck"""						)
						if "layer1_rn" in name:
												lowerCamelCase__         =  name.replace("""layer1_rn"""   ,    """convs.0"""						)
						if "layer2_rn" in name:
												lowerCamelCase__         =  name.replace("""layer2_rn"""   ,    """convs.1"""						)
						if "layer3_rn" in name:
												lowerCamelCase__         =  name.replace("""layer3_rn"""   ,    """convs.2"""						)
						if "layer4_rn" in name:
												lowerCamelCase__         =  name.replace("""layer4_rn"""   ,    """convs.3"""						)
						if "refinenet" in name:
												lowerCamelCase__         =  int(name[len("""neck.refinenet"""						) : len("""neck.refinenet"""						) + 1]						)
												# tricky here: we need to map 4 to 0, 3 to 1, 2 to 2 and 1 to 3
												lowerCamelCase__         =  name.replace(F'''refinenet{layer_idx}'''   ,    F'''fusion_stage.layers.{abs(layer_idx-4						)}'''						)
						if "out_conv" in name:
												lowerCamelCase__         =  name.replace("""out_conv"""   ,    """projection"""						)
						if "resConfUnit1" in name:
												lowerCamelCase__         =  name.replace("""resConfUnit1"""   ,    """residual_layer1"""						)
						if "resConfUnit2" in name:
												lowerCamelCase__         =  name.replace("""resConfUnit2"""   ,    """residual_layer2"""						)
						if "conv1" in name:
												lowerCamelCase__         =  name.replace("""conv1"""   ,    """convolution1"""						)
						if "conv2" in name:
												lowerCamelCase__         =  name.replace("""conv2"""   ,    """convolution2"""						)
						# readout blocks
						if "pretrained.act_postprocess1.0.project.0" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess1.0.project.0"""   ,    """neck.reassemble_stage.readout_projects.0.0"""						)
						if "pretrained.act_postprocess2.0.project.0" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess2.0.project.0"""   ,    """neck.reassemble_stage.readout_projects.1.0"""						)
						if "pretrained.act_postprocess3.0.project.0" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess3.0.project.0"""   ,    """neck.reassemble_stage.readout_projects.2.0"""						)
						if "pretrained.act_postprocess4.0.project.0" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess4.0.project.0"""   ,    """neck.reassemble_stage.readout_projects.3.0"""						)
						# resize blocks
						if "pretrained.act_postprocess1.3" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess1.3"""   ,    """neck.reassemble_stage.layers.0.projection"""						)
						if "pretrained.act_postprocess1.4" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess1.4"""   ,    """neck.reassemble_stage.layers.0.resize"""						)
						if "pretrained.act_postprocess2.3" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess2.3"""   ,    """neck.reassemble_stage.layers.1.projection"""						)
						if "pretrained.act_postprocess2.4" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess2.4"""   ,    """neck.reassemble_stage.layers.1.resize"""						)
						if "pretrained.act_postprocess3.3" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess3.3"""   ,    """neck.reassemble_stage.layers.2.projection"""						)
						if "pretrained.act_postprocess4.3" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess4.3"""   ,    """neck.reassemble_stage.layers.3.projection"""						)
						if "pretrained.act_postprocess4.4" in name:
												lowerCamelCase__         =  name.replace("""pretrained.act_postprocess4.4"""   ,    """neck.reassemble_stage.layers.3.resize"""						)
						if "pretrained" in name:
												lowerCamelCase__         =  name.replace("""pretrained"""   ,    """dpt"""						)
						if "bn" in name:
												lowerCamelCase__         =  name.replace("""bn"""   ,    """batch_norm"""						)
						if "head" in name:
												lowerCamelCase__         =  name.replace("""head"""   ,    """head.head"""						)
						if "encoder.norm" in name:
												lowerCamelCase__         =  name.replace("""encoder.norm"""   ,    """layernorm"""						)
						if "auxlayer" in name:
												lowerCamelCase__         =  name.replace("""auxlayer"""   ,    """auxiliary_head.head"""						)

						return name
def 						A__			(				__lowerCAmelCase		:			Optional[int]   ,    __lowerCAmelCase		:			Tuple						):
						for i in range(config.num_hidden_layers						):
												# read in weights + bias of input projection layer (in timm, this is a single matrix + bias)
												lowerCamelCase__         =  state_dict.pop(F'''dpt.encoder.layer.{i}.attn.qkv.weight'''						)
												lowerCamelCase__         =  state_dict.pop(F'''dpt.encoder.layer.{i}.attn.qkv.bias'''						)
												# next, add query, keys and values (in that order) to the state dict
												lowerCamelCase__         =  in_proj_weight[: config.hidden_size, :]
												lowerCamelCase__         =  in_proj_bias[: config.hidden_size]
												lowerCamelCase__         =  in_proj_weight[
												    config.hidden_size : config.hidden_size * 2, :
												]
												lowerCamelCase__         =  in_proj_bias[
												    config.hidden_size : config.hidden_size * 2
												]
												lowerCamelCase__         =  in_proj_weight[
												    -config.hidden_size :, :
												]
												lowerCamelCase__         =  in_proj_bias[-config.hidden_size :]
def 						A__			(				):
						lowerCamelCase__         =  """http://images.cocodataset.org/val2017/000000039769.jpg"""
						lowerCamelCase__         =  Image.open(requests.get(__lowerCAmelCase   ,    stream=__lowerCAmelCase						).raw						)
						return im
@torch.no_grad()
def 						A__			(				__lowerCAmelCase		:			int   ,    __lowerCAmelCase		:			Dict   ,    __lowerCAmelCase		:			Union[str, Any]   ,    __lowerCAmelCase		:			Tuple						):
						lowerCamelCase__       ,			lowerCamelCase__         =  get_dpt_config(__lowerCAmelCase						)
						# load original state_dict from URL
						lowerCamelCase__         =  torch.hub.load_state_dict_from_url(__lowerCAmelCase   ,    map_location="""cpu"""						)
						# remove certain keys
						remove_ignore_keys_(__lowerCAmelCase						)
						# rename keys
						for key in state_dict.copy().keys():
												lowerCamelCase__         =  state_dict.pop(__lowerCAmelCase						)
												lowerCamelCase__         =  val
						# read in qkv matrices
						read_in_q_k_v(__lowerCAmelCase   ,    __lowerCAmelCase						)

						# load HuggingFace model
						lowerCamelCase__         =  DPTForSemanticSegmentation(__lowerCAmelCase						) if """ade""" in checkpoint_url else DPTForDepthEstimation(__lowerCAmelCase						)
						model.load_state_dict(__lowerCAmelCase						)
						model.eval()

						# Check outputs on an image
						lowerCamelCase__         =  480 if """ade""" in checkpoint_url else 384
						lowerCamelCase__         =  DPTImageProcessor(size=__lowerCAmelCase						)

						lowerCamelCase__         =  prepare_img()
						lowerCamelCase__         =  image_processor(__lowerCAmelCase   ,    return_tensors="""pt"""						)

						# forward pass
						lowerCamelCase__         =  model(**__lowerCAmelCase						).logits if """ade""" in checkpoint_url else model(**__lowerCAmelCase						).predicted_depth

						# Assert logits
						lowerCamelCase__         =  torch.tensor([[6.3199, 6.3629, 6.4148], [6.3850, 6.3615, 6.4166], [6.3519, 6.3176, 6.3575]]						)
						if "ade" in checkpoint_url:
												lowerCamelCase__         =  torch.tensor([[4.0480, 4.2420, 4.4360], [4.3124, 4.5693, 4.8261], [4.5768, 4.8965, 5.2163]]						)
						assert outputs.shape == torch.Size(__lowerCAmelCase						)
						assert (
						    torch.allclose(outputs[0, 0, :3, :3]   ,    __lowerCAmelCase   ,    atol=1e-4						)
						    if "ade" in checkpoint_url
						    else torch.allclose(outputs[0, :3, :3]   ,    __lowerCAmelCase						)
						)

						Path(__lowerCAmelCase						).mkdir(exist_ok=__lowerCAmelCase						)
						print(F'''Saving model to {pytorch_dump_folder_path}'''						)
						model.save_pretrained(__lowerCAmelCase						)
						print(F'''Saving image processor to {pytorch_dump_folder_path}'''						)
						image_processor.save_pretrained(__lowerCAmelCase						)

						if push_to_hub:
												print("""Pushing model to hub..."""						)
												model.push_to_hub(
												    repo_path_or_name=Path(__lowerCAmelCase   ,    __lowerCAmelCase						)   ,    organization="""nielsr"""   ,    commit_message="""Add model"""   ,    use_temp_dir=__lowerCAmelCase   ,    )
												image_processor.push_to_hub(
												    repo_path_or_name=Path(__lowerCAmelCase   ,    __lowerCAmelCase						)   ,    organization="""nielsr"""   ,    commit_message="""Add image processor"""   ,    use_temp_dir=__lowerCAmelCase   ,    )


if __name__ == "__main__":
							UpperCamelCase    :      int  			=		argparse.ArgumentParser()
							# Required parameters
							parser.add_argument(
							    '--checkpoint_url',
							    default='https://github.com/intel-isl/DPT/releases/download/1_0/dpt_large-midas-2f21e586.pt',
							    type=str,
							    help='URL of the original DPT checkpoint you\'d like to convert.',
							)
							parser.add_argument(
							    '--pytorch_dump_folder_path',
							    default=None,
							    type=str,
							    required=True,
							    help='Path to the output PyTorch model directory.',
							)
							parser.add_argument(
							    '--push_to_hub',
							    action='store_true',
							)
							parser.add_argument(
							    '--model_name',
							    default='dpt-large',
							    type=str,
							    help='Name of the model, in case you\'re pushing to the hub.',
							)

							UpperCamelCase    :      List[str]  			=		parser.parse_args()
							convert_dpt_checkpoint(args.checkpoint_url, args.pytorch_dump_folder_path, args.push_to_hub, args.model_name)









'''simple docstring'''







import os
import tempfile
import unittest
from pathlib import Path

from transformers import AutoConfig, is_tf_available
from transformers.testing_utils import require_tf


if is_tf_available():
							import tensorflow as tf

							from transformers import TensorFlowBenchmark, TensorFlowBenchmarkArguments




@require_tf
class 		UpperCamelCase__    (unittest.TestCase			):




		'''simple docstring'''





		def 			UpperCamelCase_					(      self   ,_lowerCAmelCase       ):
								for model_result in results.values():
														for batch_size, sequence_length in zip(model_result["""bs"""]   ,model_result["""ss"""]       ):
																				lowerCamelCase__         =  model_result["""result"""][batch_size][sequence_length]
																				self.assertIsNotNone(_lowerCAmelCase       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sshleifer/tiny-gpt2"""
								lowerCamelCase__         =  TensorFlowBenchmarkArguments(
								    models=[MODEL_ID]   ,training=_lowerCAmelCase   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,eager_mode=_lowerCAmelCase   ,multi_process=_lowerCAmelCase   ,)
								lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase       )
								lowerCamelCase__         =  benchmark.run()
								self.check_results_dict_not_empty(results.time_inference_result       )
								self.check_results_dict_not_empty(results.memory_inference_result       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sgugger/tiny-distilbert-classification"""
								lowerCamelCase__         =  TensorFlowBenchmarkArguments(
								    models=[MODEL_ID]   ,training=_lowerCAmelCase   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,multi_process=_lowerCAmelCase   ,only_pretrain_model=_lowerCAmelCase   ,)
								lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase       )
								lowerCamelCase__         =  benchmark.run()
								self.check_results_dict_not_empty(results.time_inference_result       )
								self.check_results_dict_not_empty(results.memory_inference_result       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sshleifer/tiny-gpt2"""
								lowerCamelCase__         =  TensorFlowBenchmarkArguments(
								    models=[MODEL_ID]   ,training=_lowerCAmelCase   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,multi_process=_lowerCAmelCase   ,)
								lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase       )
								lowerCamelCase__         =  benchmark.run()
								self.check_results_dict_not_empty(results.time_inference_result       )
								self.check_results_dict_not_empty(results.memory_inference_result       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sshleifer/tiny-gpt2"""
								lowerCamelCase__         =  AutoConfig.from_pretrained(_lowerCAmelCase       )
								lowerCamelCase__         =  TensorFlowBenchmarkArguments(
								    models=[MODEL_ID]   ,training=_lowerCAmelCase   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,eager_mode=_lowerCAmelCase   ,multi_process=_lowerCAmelCase   ,)
								lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase   ,[config]       )
								lowerCamelCase__         =  benchmark.run()
								self.check_results_dict_not_empty(results.time_inference_result       )
								self.check_results_dict_not_empty(results.memory_inference_result       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sshleifer/tiny-gpt2"""
								lowerCamelCase__         =  AutoConfig.from_pretrained(_lowerCAmelCase       )
								lowerCamelCase__         =  TensorFlowBenchmarkArguments(
								    models=[MODEL_ID]   ,training=_lowerCAmelCase   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,multi_process=_lowerCAmelCase   ,)
								lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase   ,[config]       )
								lowerCamelCase__         =  benchmark.run()
								self.check_results_dict_not_empty(results.time_inference_result       )
								self.check_results_dict_not_empty(results.memory_inference_result       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sshleifer/tiny-gpt2"""
								lowerCamelCase__         =  TensorFlowBenchmarkArguments(
								    models=[MODEL_ID]   ,training=_lowerCAmelCase   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,multi_process=_lowerCAmelCase   ,)
								lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase       )
								lowerCamelCase__         =  benchmark.run()
								self.check_results_dict_not_empty(results.time_train_result       )
								self.check_results_dict_not_empty(results.memory_train_result       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sshleifer/tiny-gpt2"""
								lowerCamelCase__         =  AutoConfig.from_pretrained(_lowerCAmelCase       )
								lowerCamelCase__         =  TensorFlowBenchmarkArguments(
								    models=[MODEL_ID]   ,training=_lowerCAmelCase   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,multi_process=_lowerCAmelCase   ,)
								lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase   ,[config]       )
								lowerCamelCase__         =  benchmark.run()
								self.check_results_dict_not_empty(results.time_train_result       )
								self.check_results_dict_not_empty(results.memory_train_result       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """patrickvonplaten/t5-tiny-random"""
								lowerCamelCase__         =  AutoConfig.from_pretrained(_lowerCAmelCase       )
								lowerCamelCase__         =  TensorFlowBenchmarkArguments(
								    models=[MODEL_ID]   ,training=_lowerCAmelCase   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,multi_process=_lowerCAmelCase   ,)
								lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase   ,configs=[config]       )
								lowerCamelCase__         =  benchmark.run()
								self.check_results_dict_not_empty(results.time_inference_result       )
								self.check_results_dict_not_empty(results.memory_inference_result       )






		@unittest.skipIf(is_tf_available() and len(tf.config.list_physical_devices("""GPU"""       )       ) == 0   ,"""Cannot do xla on CPU."""       )
		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sshleifer/tiny-gpt2"""
								lowerCamelCase__         =  TensorFlowBenchmarkArguments(
								    models=[MODEL_ID]   ,training=_lowerCAmelCase   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,use_xla=_lowerCAmelCase   ,multi_process=_lowerCAmelCase   ,)
								lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase       )
								lowerCamelCase__         =  benchmark.run()
								self.check_results_dict_not_empty(results.time_inference_result       )
								self.check_results_dict_not_empty(results.memory_inference_result       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sshleifer/tiny-gpt2"""
								with tempfile.TemporaryDirectory() as tmp_dir:
														lowerCamelCase__         =  TensorFlowBenchmarkArguments(
														    models=[MODEL_ID]   ,inference=_lowerCAmelCase   ,save_to_csv=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,inference_time_csv_file=os.path.join(_lowerCAmelCase   ,"""inf_time.csv"""       )   ,inference_memory_csv_file=os.path.join(_lowerCAmelCase   ,"""inf_mem.csv"""       )   ,env_info_csv_file=os.path.join(_lowerCAmelCase   ,"""env.csv"""       )   ,multi_process=_lowerCAmelCase   ,)
														lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase       )
														benchmark.run()
														self.assertTrue(Path(os.path.join(_lowerCAmelCase   ,"""inf_time.csv"""       )       ).exists()       )
														self.assertTrue(Path(os.path.join(_lowerCAmelCase   ,"""inf_mem.csv"""       )       ).exists()       )
														self.assertTrue(Path(os.path.join(_lowerCAmelCase   ,"""env.csv"""       )       ).exists()       )






		def 			UpperCamelCase_					(      self       ):
								lowerCamelCase__         =  """sshleifer/tiny-gpt2"""

								def _check_summary_is_not_empty(_lowerCAmelCase       ):
														self.assertTrue(hasattr(_lowerCAmelCase   ,"""sequential"""       )       )
														self.assertTrue(hasattr(_lowerCAmelCase   ,"""cumulative"""       )       )
														self.assertTrue(hasattr(_lowerCAmelCase   ,"""current"""       )       )
														self.assertTrue(hasattr(_lowerCAmelCase   ,"""total"""       )       )

								with tempfile.TemporaryDirectory() as tmp_dir:
														lowerCamelCase__         =  TensorFlowBenchmarkArguments(
														    models=[MODEL_ID]   ,inference=_lowerCAmelCase   ,sequence_lengths=[8]   ,batch_sizes=[1]   ,log_filename=os.path.join(_lowerCAmelCase   ,"""log.txt"""       )   ,log_print=_lowerCAmelCase   ,trace_memory_line_by_line=_lowerCAmelCase   ,eager_mode=_lowerCAmelCase   ,multi_process=_lowerCAmelCase   ,)
														lowerCamelCase__         =  TensorFlowBenchmark(_lowerCAmelCase       )
														lowerCamelCase__         =  benchmark.run()
														_check_summary_is_not_empty(result.inference_summary       )
														self.assertTrue(Path(os.path.join(_lowerCAmelCase   ,"""log.txt"""       )       ).exists()       )

