

import os
import time

import numpy as np
import onnxruntime as ort


snake_case_        =			'''1'''
snake_case_        =			'''0'''
snake_case_        =			'''1'''

snake_case_        =			ort.SessionOptions()
snake_case_        =			ort.GraphOptimizationLevel.ORT_DISABLE_ALL
print('''Create inference session...''')
snake_case_        =			['''TensorrtExecutionProvider''', '''CUDAExecutionProvider''']
snake_case_        =			ort.InferenceSession('''model.onnx''', sess_options=sess_opt, providers=execution_provider)
snake_case_        =			ort.RunOptions()

snake_case_        =			128
snake_case_        =			1
snake_case_        =			np.ones((batch, sequence), dtype=np.intaa)
snake_case_        =			np.ones((batch, sequence), dtype=np.intaa)
snake_case_        =			np.ones((batch, sequence), dtype=np.intaa)

print('''Warm up phase...''')
sess.run(
    None,
    {
        sess.get_inputs()[0].name: input_ids,
        sess.get_inputs()[1].name: attention_mask,
        sess.get_inputs()[2].name: token_type_ids,
    },
    run_options=run_opt,
)

print('''Start inference...''')
snake_case_        =			time.time()
snake_case_        =			2_000
snake_case_        =			{}
for iter in range(max_iters):
       snake_case_        =			sess.run(
           None,
           {
               sess.get_inputs()[0].name: input_ids,
               sess.get_inputs()[1].name: attention_mask,
               sess.get_inputs()[2].name: token_type_ids,
           },
           run_options=run_opt,
       )
print('''Average Inference Time = {:.3f} ms'''.format((time.time() - start_time) * 1_000 / max_iters))









import warnings

from diffusers import StableDiffusionInpaintPipeline as StableDiffusionInpaintPipeline  # noqa F401


warnings.warn(
    '''The `inpainting.py` script is outdated. Please use directly `from diffusers import'''
    ''' StableDiffusionInpaintPipeline` instead.'''
)

