




"""simple docstring"""

import json
import os
from functools import lru_cache
from typing import List, Optional, Tuple

import regex as re

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


UpperCamelCase__			:     str			       =				logging.get_logger(__name__)


UpperCamelCase__			:     Any			       =				{"vocab_file": "vocab.json", "merges_file": "merges.txt"}

# See all MVP models at https://huggingface.co/models?filter=mvp
UpperCamelCase__			:     str			       =				{
    "vocab_file": {
        "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/vocab.json",
    },
    "added_tokens.json": {
        "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/added_tokens.json",
    },
    "merges_file": {
        "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/merges.txt",
    },
}

UpperCamelCase__			:     str			       =				{
    "RUCAIBox/mvp": 10_24,
}




@lru_cache()
def    snake_case__						(							):
					__snake_case        =						(
					    list(range(ord("""!"""		)					,       ord("""~"""		) + 1		)		) + list(range(ord("""¡"""		)					,       ord("""¬"""		) + 1		)		) + list(range(ord("""®"""		)					,       ord("""ÿ"""		) + 1		)		)
					)
					__snake_case        =						bs[:]
					__snake_case        =						0
					for b in range(2**8		):
										if b not in bs:
															bs.append(lowerCAmelCase		)
															cs.append(2**8 + n		)
															n += 1
					__snake_case        =						[chr(lowerCAmelCase		) for n in cs]
					return dict(zip(lowerCAmelCase					,       lowerCAmelCase		)		)




def    snake_case__						(							lowerCAmelCase :		Optional[int]		):
					__snake_case        =						set()
					__snake_case        =						word[0]
					for char in word[1:]:
										pairs.add((prev_char, char)		)
										__snake_case        =						char
					return pairs

class      A__   (   lowercase_  ):
	A_				:					List[str]      =   VOCAB_FILES_NAMES
	A_				:					Any      =   PRETRAINED_VOCAB_FILES_MAP
	A_				:					Optional[Any]      =   PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	A_				:					Union[str, Any]      =   ["""input_ids""", """attention_mask"""]




	def __init__( self	:						Tuple   ,     lowercase	:						Optional[int]   ,     lowercase	:						Union[str, Any]   ,     lowercase	:						Union[str, Any]="replace"   ,     lowercase	:						Dict="<s>"   ,     lowercase	:						Any="</s>"   ,     lowercase	:						List[Any]="</s>"   ,     lowercase	:						List[Any]="<s>"   ,     lowercase	:						Optional[Any]="<unk>"   ,     lowercase	:						int="<pad>"   ,     lowercase	:						List[str]="<mask>"   ,     lowercase	:						Any=False   ,     **lowercase	:						Optional[int]   ,     )       ->			Tuple:
						__snake_case        =						AddedToken(lowercase   ,     lstrip=lowercase   ,     rstrip=lowercase						) if isinstance(lowercase   ,     lowercase						) else bos_token
						__snake_case        =						AddedToken(lowercase   ,     lstrip=lowercase   ,     rstrip=lowercase						) if isinstance(lowercase   ,     lowercase						) else eos_token
						__snake_case        =						AddedToken(lowercase   ,     lstrip=lowercase   ,     rstrip=lowercase						) if isinstance(lowercase   ,     lowercase						) else sep_token
						__snake_case        =						AddedToken(lowercase   ,     lstrip=lowercase   ,     rstrip=lowercase						) if isinstance(lowercase   ,     lowercase						) else cls_token
						__snake_case        =						AddedToken(lowercase   ,     lstrip=lowercase   ,     rstrip=lowercase						) if isinstance(lowercase   ,     lowercase						) else unk_token
						__snake_case        =						AddedToken(lowercase   ,     lstrip=lowercase   ,     rstrip=lowercase						) if isinstance(lowercase   ,     lowercase						) else pad_token

						# Mask token behave like a normal word, i.e. include the space before it
						__snake_case        =						AddedToken(lowercase   ,     lstrip=lowercase   ,     rstrip=lowercase						) if isinstance(lowercase   ,     lowercase						) else mask_token

						super().__init__(
						    errors=lowercase   ,     bos_token=lowercase   ,     eos_token=lowercase   ,     unk_token=lowercase   ,     sep_token=lowercase   ,     cls_token=lowercase   ,     pad_token=lowercase   ,     mask_token=lowercase   ,     add_prefix_space=lowercase   ,     **lowercase   ,     )
						with open(lowercase   ,     encoding="""utf-8"""						) as vocab_handle:
											__snake_case        =						json.load(lowercase						)
						__snake_case        =						{v: k for k, v in self.encoder.items()}
						__snake_case        =						errors  # how to handle errors in decoding
						__snake_case        =						bytes_to_unicode()
						__snake_case        =						{v: k for k, v in self.byte_encoder.items()}
						with open(lowercase   ,     encoding="""utf-8"""						) as merges_handle:
											__snake_case        =						merges_handle.read().split("""\n"""						)[1:-1]
						__snake_case        =						[tuple(merge.split()						) for merge in bpe_merges]
						__snake_case        =						dict(zip(lowercase   ,     range(len(lowercase						)						)						)						)
						__snake_case        =						{}
						__snake_case        =						add_prefix_space

						# Should have added re.IGNORECASE so BPE merges can happen for capitalized versions of contractions
						__snake_case        =						re.compile(r"""'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+"""						)




	@property
	def 				a_		( self	:						List[str]						)       ->			Any:
						return len(self.encoder						)




	def 				a_		( self	:						str						)       ->			str:
						return dict(self.encoder   ,     **self.added_tokens_encoder						)




	def 				a_		( self	:						int   ,     lowercase	:						Optional[Any]						)       ->			int:
						if token in self.cache:
											return self.cache[token]
						__snake_case        =						tuple(lowercase						)
						__snake_case        =						get_pairs(lowercase						)

						if not pairs:
											return token

						while True:
											__snake_case        =						min(lowercase   ,     key=lambda lowercase						: self.bpe_ranks.get(lowercase   ,     float("""inf"""						)						)						)
											if bigram not in self.bpe_ranks:
																break
											__snake_case   ,   __snake_case        =						bigram
											__snake_case        =						[]
											__snake_case        =						0
											while i < len(lowercase						):
																try:
																					__snake_case        =						word.index(lowercase   ,     lowercase						)
																except ValueError:
																					new_word.extend(word[i:]						)
																					break
																else:
																					new_word.extend(word[i:j]						)
																					__snake_case        =						j

																if word[i] == first and i < len(lowercase						) - 1 and word[i + 1] == second:
																					new_word.append(first + second						)
																					i += 2
																else:
																					new_word.append(word[i]						)
																					i += 1
											__snake_case        =						tuple(lowercase						)
											__snake_case        =						new_word
											if len(lowercase						) == 1:
																break
											else:
																__snake_case        =						get_pairs(lowercase						)
						__snake_case        =						""" """.join(lowercase						)
						__snake_case        =						word
						return word




	def 				a_		( self	:						List[str]   ,     lowercase	:						Optional[int]						)       ->			List[str]:
						__snake_case        =						[]
						for token in re.findall(self.pat   ,     lowercase						):
											__snake_case        =						"""""".join(
											    self.byte_encoder[b] for b in token.encode("""utf-8"""						)						)  # Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
											bpe_tokens.extend(bpe_token for bpe_token in self.bpe(lowercase						).split(""" """						)						)
						return bpe_tokens




	def 				a_		( self	:						Dict   ,     lowercase	:						List[Any]						)       ->			List[Any]:
						return self.encoder.get(lowercase   ,     self.encoder.get(self.unk_token						)						)




	def 				a_		( self	:						Optional[int]   ,     lowercase	:						Optional[Any]						)       ->			List[str]:
						return self.decoder.get(lowercase						)




	def 				a_		( self	:						Tuple   ,     lowercase	:						int						)       ->			Any:
						__snake_case        =						"""""".join(lowercase						)
						__snake_case        =						bytearray([self.byte_decoder[c] for c in text]						).decode("""utf-8"""   ,     errors=self.errors						)
						return text




	def 				a_		( self	:						List[Any]   ,     lowercase	:						str   ,     lowercase	:						Optional[str] = None						)       ->			Tuple[str]:
						if not os.path.isdir(lowercase						):
											logger.error(f'''Vocabulary path ({save_directory}) should be a directory'''						)
											return
						__snake_case        =						os.path.join(
						    lowercase   ,     (filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""vocab_file"""]						)
						__snake_case        =						os.path.join(
						    lowercase   ,     (filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""merges_file"""]						)

						with open(lowercase   ,     """w"""   ,     encoding="""utf-8"""						) as f:
											f.write(json.dumps(self.encoder   ,     indent=2   ,     sort_keys=lowercase   ,     ensure_ascii=lowercase						) + """\n"""						)

						__snake_case        =						0
						with open(lowercase   ,     """w"""   ,     encoding="""utf-8"""						) as writer:
											writer.write("""#version: 0.2\n"""						)
											for bpe_tokens, token_index in sorted(self.bpe_ranks.items()   ,     key=lambda lowercase						: kv[1]						):
																if index != token_index:
																					logger.warning(
																					    f'''Saving vocabulary to {merge_file}: BPE merge indices are not consecutive.'''
																					    """ Please check that the tokenizer is not corrupted!"""						)
																					__snake_case        =						token_index
																writer.write(""" """.join(lowercase						) + """\n"""						)
																index += 1

						return vocab_file, merge_file




	def 				a_		( self	:						List[Any]   ,     lowercase	:						List[int]   ,     lowercase	:						Optional[List[int]] = None						)       ->			List[int]:
						if token_ids_a is None:
											return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
						__snake_case        =						[self.cls_token_id]
						__snake_case        =						[self.sep_token_id]
						return cls + token_ids_a + sep + sep + token_ids_a + sep




	def 				a_		( self	:						Optional[Any]   ,     lowercase	:						List[int]   ,     lowercase	:						Optional[List[int]] = None   ,     lowercase	:						bool = False						)       ->			List[int]:
						if already_has_special_tokens:
											return super().get_special_tokens_mask(
											    token_ids_a=lowercase   ,     token_ids_a=lowercase   ,     already_has_special_tokens=lowercase						)

						if token_ids_a is None:
											return [1] + ([0] * len(lowercase						)) + [1]
						return [1] + ([0] * len(lowercase						)) + [1, 1] + ([0] * len(lowercase						)) + [1]




	def 				a_		( self	:						Tuple   ,     lowercase	:						List[int]   ,     lowercase	:						Optional[List[int]] = None						)       ->			List[int]:
						__snake_case        =						[self.sep_token_id]
						__snake_case        =						[self.cls_token_id]

						if token_ids_a is None:
											return len(cls + token_ids_a + sep						) * [0]
						return len(cls + token_ids_a + sep + sep + token_ids_a + sep						) * [0]




	def 				a_		( self	:						Union[str, Any]   ,     lowercase	:						List[Any]   ,     lowercase	:						int=False   ,     **lowercase	:						str						)       ->			Tuple:
						__snake_case        =						kwargs.pop("""add_prefix_space"""   ,     self.add_prefix_space						)
						if (is_split_into_words or add_prefix_space) and (len(lowercase						) > 0 and not text[0].isspace()):
											__snake_case        =						""" """ + text
						return (text, kwargs)








"""simple docstring"""

import tempfile
import unittest

from transformers import DPRConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
		import torch

		from transformers import DPRContextEncoder, DPRQuestionEncoder, DPRReader, DPRReaderTokenizer
		from transformers.models.dpr.modeling_dpr import (
		    DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
		    DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
		    DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST,
		)
class      A__   :




	def __init__( self	:						Optional[int]   ,     lowercase	:						List[Any]   ,     lowercase	:						Optional[int]=13   ,     lowercase	:						List[Any]=7   ,     lowercase	:						Any=False   ,     lowercase	:						Optional[int]=True   ,     lowercase	:						Any=True   ,     lowercase	:						Optional[Any]=True   ,     lowercase	:						Tuple=99   ,     lowercase	:						Union[str, Any]=32   ,     lowercase	:						Any=5   ,     lowercase	:						Dict=4   ,     lowercase	:						Dict=37   ,     lowercase	:						Tuple="gelu"   ,     lowercase	:						str=0.1   ,     lowercase	:						Union[str, Any]=0.1   ,     lowercase	:						Any=512   ,     lowercase	:						Optional[Any]=16   ,     lowercase	:						Any=2   ,     lowercase	:						List[str]=0.02   ,     lowercase	:						List[str]=3   ,     lowercase	:						Optional[int]=4   ,     lowercase	:						Any=None   ,     lowercase	:						Optional[int]=0   ,     )       ->			Optional[Any]:
						__snake_case        =						parent
						__snake_case        =						batch_size
						__snake_case        =						seq_length
						__snake_case        =						is_training
						__snake_case        =						use_input_mask
						__snake_case        =						use_token_type_ids
						__snake_case        =						use_labels
						__snake_case        =						vocab_size
						__snake_case        =						hidden_size
						__snake_case        =						num_hidden_layers
						__snake_case        =						num_attention_heads
						__snake_case        =						intermediate_size
						__snake_case        =						hidden_act
						__snake_case        =						hidden_dropout_prob
						__snake_case        =						attention_probs_dropout_prob
						__snake_case        =						max_position_embeddings
						__snake_case        =						type_vocab_size
						__snake_case        =						type_sequence_label_size
						__snake_case        =						initializer_range
						__snake_case        =						num_labels
						__snake_case        =						num_choices
						__snake_case        =						scope
						__snake_case        =						projection_dim




	def 				a_		( self	:						str						)       ->			Optional[Any]:
						__snake_case        =						ids_tensor([self.batch_size, self.seq_length]   ,     self.vocab_size						)

						__snake_case        =						None
						if self.use_input_mask:
											__snake_case        =						random_attention_mask([self.batch_size, self.seq_length]						)

						__snake_case        =						None
						if self.use_token_type_ids:
											__snake_case        =						ids_tensor([self.batch_size, self.seq_length]   ,     self.type_vocab_size						)

						__snake_case        =						None
						__snake_case        =						None
						__snake_case        =						None
						if self.use_labels:
											__snake_case        =						ids_tensor([self.batch_size]   ,     self.type_sequence_label_size						)
											__snake_case        =						ids_tensor([self.batch_size, self.seq_length]   ,     self.num_labels						)
											__snake_case        =						ids_tensor([self.batch_size]   ,     self.num_choices						)

						__snake_case        =						self.get_config()

						return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels




	def 				a_		( self	:						str						)       ->			str:
						return DPRConfig(
						    projection_dim=self.projection_dim   ,     vocab_size=self.vocab_size   ,     hidden_size=self.hidden_size   ,     num_hidden_layers=self.num_hidden_layers   ,     num_attention_heads=self.num_attention_heads   ,     intermediate_size=self.intermediate_size   ,     hidden_act=self.hidden_act   ,     hidden_dropout_prob=self.hidden_dropout_prob   ,     attention_probs_dropout_prob=self.attention_probs_dropout_prob   ,     max_position_embeddings=self.max_position_embeddings   ,     type_vocab_size=self.type_vocab_size   ,     initializer_range=self.initializer_range   ,     )




	def 				a_		( self	:						Optional[Any]   ,     lowercase	:						str   ,     lowercase	:						Optional[Any]   ,     lowercase	:						str   ,     lowercase	:						Dict   ,     lowercase	:						Union[str, Any]   ,     lowercase	:						Any   ,     lowercase	:						List[str]						)       ->			Optional[Any]:
						__snake_case        =						DPRContextEncoder(config=lowercase						)
						model.to(lowercase						)
						model.eval()
						__snake_case        =						model(lowercase   ,     attention_mask=lowercase   ,     token_type_ids=lowercase						)
						__snake_case        =						model(lowercase   ,     token_type_ids=lowercase						)
						__snake_case        =						model(lowercase						)
						self.parent.assertEqual(result.pooler_output.shape   ,     (self.batch_size, self.projection_dim or self.hidden_size)						)




	def 				a_		( self	:						Tuple   ,     lowercase	:						Tuple   ,     lowercase	:						Union[str, Any]   ,     lowercase	:						List[str]   ,     lowercase	:						Optional[int]   ,     lowercase	:						Any   ,     lowercase	:						Tuple   ,     lowercase	:						Union[str, Any]						)       ->			Optional[int]:
						__snake_case        =						DPRQuestionEncoder(config=lowercase						)
						model.to(lowercase						)
						model.eval()
						__snake_case        =						model(lowercase   ,     attention_mask=lowercase   ,     token_type_ids=lowercase						)
						__snake_case        =						model(lowercase   ,     token_type_ids=lowercase						)
						__snake_case        =						model(lowercase						)
						self.parent.assertEqual(result.pooler_output.shape   ,     (self.batch_size, self.projection_dim or self.hidden_size)						)




	def 				a_		( self	:						str   ,     lowercase	:						List[Any]   ,     lowercase	:						int   ,     lowercase	:						Optional[Any]   ,     lowercase	:						Any   ,     lowercase	:						Tuple   ,     lowercase	:						Optional[Any]   ,     lowercase	:						int						)       ->			str:
						__snake_case        =						DPRReader(config=lowercase						)
						model.to(lowercase						)
						model.eval()
						__snake_case        =						model(
						    lowercase   ,     attention_mask=lowercase   ,     )

						self.parent.assertEqual(result.start_logits.shape   ,     (self.batch_size, self.seq_length)						)
						self.parent.assertEqual(result.end_logits.shape   ,     (self.batch_size, self.seq_length)						)
						self.parent.assertEqual(result.relevance_logits.shape   ,     (self.batch_size,)						)




	def 				a_		( self	:						str						)       ->			Optional[Any]:
						__snake_case        =						self.prepare_config_and_inputs()
						(
						    (
						    __snake_case
						)   ,   (
						    __snake_case
						)   ,   (
						    __snake_case
						)   ,   (
						    __snake_case
						)   ,   (
						    __snake_case
						)   ,   (
						    __snake_case
						)   ,   (
						    __snake_case
						)   ,   
						)        =						config_and_inputs
						__snake_case        =						{"""input_ids""": input_ids}
						return config, inputs_dict

@require_torch
class      A__   (   lowercase_  ,						lowercase_  ,						unittest.TestCase  ):
	A_				:					Dict      =   (
	    (
	        DPRContextEncoder,
	        DPRQuestionEncoder,
	        DPRReader,
	    )
	    if is_torch_available()
	    else ()
	)
	A_				:					Any      =   {"""feature-extraction""": DPRQuestionEncoder} if is_torch_available() else {}

	A_				:					List[Any]      =   False
	A_				:					Union[str, Any]      =   False  # why?
	A_				:					Any      =   False
	A_				:					List[str]      =   False




	def 				a_		( self	:						Union[str, Any]						)       ->			Dict:
						__snake_case        =						DPRModelTester(self						)
						__snake_case        =						ConfigTester(self   ,     config_class=lowercase   ,     hidden_size=37						)




	def 				a_		( self	:						Optional[int]						)       ->			Optional[int]:
						self.config_tester.run_common_tests()




	def 				a_		( self	:						Dict						)       ->			List[str]:
						__snake_case        =						self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_context_encoder(*lowercase						)




	def 				a_		( self	:						Any						)       ->			Tuple:
						__snake_case        =						self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_question_encoder(*lowercase						)




	def 				a_		( self	:						Any						)       ->			Optional[int]:
						__snake_case        =						self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_reader(*lowercase						)




	def 				a_		( self	:						Tuple						)       ->			str:
						__snake_case        =						self.model_tester.prepare_config_and_inputs()[0]

						__snake_case        =						DPRQuestionEncoder(config=lowercase						)
						model.to(lowercase						)
						model.eval()

						with tempfile.TemporaryDirectory() as tmp_dirname:
											model.save_pretrained(lowercase						)
											__snake_case        =						DPRQuestionEncoder.from_pretrained(lowercase   ,     projection_dim=512						)

						self.assertIsNotNone(lowercase						)




	@slow
	def 				a_		( self	:						Any						)       ->			Optional[Any]:
						for model_name in DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
											__snake_case        =						DPRContextEncoder.from_pretrained(lowercase						)
											self.assertIsNotNone(lowercase						)

						for model_name in DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
											__snake_case        =						DPRContextEncoder.from_pretrained(lowercase						)
											self.assertIsNotNone(lowercase						)

						for model_name in DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
											__snake_case        =						DPRQuestionEncoder.from_pretrained(lowercase						)
											self.assertIsNotNone(lowercase						)

						for model_name in DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
											__snake_case        =						DPRReader.from_pretrained(lowercase						)
											self.assertIsNotNone(lowercase						)

@require_torch
class      A__   (   unittest.TestCase  ):




	@slow
	def 				a_		( self	:						List[str]						)       ->			Union[str, Any]:
						__snake_case        =						DPRQuestionEncoder.from_pretrained("""facebook/dpr-question_encoder-single-nq-base"""   ,     return_dict=lowercase						)
						model.to(lowercase						)

						__snake_case        =						torch.tensor(
						    [[101, 7_592, 1_010, 2_003, 2_026, 3_899, 10_140, 1_029, 102]]   ,     dtype=torch.long   ,     device=lowercase						)  # [CLS] hello, is my dog cute? [SEP]
						__snake_case        =						model(lowercase						)[0]  # embedding shape = (1, 768)
						# compare the actual values for a slice.
						__snake_case        =						torch.tensor(
						    [
						        [
						            0.03_23_62_53,
						            0.12_75_33_35,
						            0.16_81_85_09,
						            0.00_27_97_86,
						            0.3_89_69_33,
						            0.24_26_49_45,
						            0.2_17_89_71,
						            -0.02_33_52_27,
						            -0.08_48_19_59,
						            -0.14_32_41_17,
						        ]
						    ]   ,     dtype=torch.float   ,     device=lowercase   ,     )
						self.assertTrue(torch.allclose(output[:, :10]   ,     lowercase   ,     atol=1e-4						)						)




	@slow
	def 				a_		( self	:						Tuple						)       ->			int:
						__snake_case        =						DPRReaderTokenizer.from_pretrained("""facebook/dpr-reader-single-nq-base"""						)
						__snake_case        =						DPRReader.from_pretrained("""facebook/dpr-reader-single-nq-base"""						)
						model.to(lowercase						)

						__snake_case        =						tokenizer(
						    questions="""What is love ?"""   ,     titles="""Haddaway"""   ,     texts="""What Is Love is a song recorded by the artist Haddaway"""   ,     padding=lowercase   ,     return_tensors="""pt"""   ,     )
						encoded_inputs.to(lowercase						)

						__snake_case        =						model(**lowercase						)

						# compare the actual values for a slice.
						__snake_case        =						torch.tensor(
						    [[-10.30_05, -10.77_65, -11.48_72, -11.68_41, -11.93_12, -10.30_02, -9.85_44, -11.73_78, -12.08_21, -10.29_75]]   ,     dtype=torch.float   ,     device=lowercase   ,     )

						__snake_case        =						torch.tensor(
						    [[-11.06_84, -11.70_41, -11.53_97, -10.34_65, -10.87_91, -6.84_43, -11.99_59, -11.03_64, -10.00_96, -6.84_05]]   ,     dtype=torch.float   ,     device=lowercase   ,     )
						self.assertTrue(torch.allclose(outputs.start_logits[:, :10]   ,     lowercase   ,     atol=1e-4						)						)
						self.assertTrue(torch.allclose(outputs.end_logits[:, :10]   ,     lowercase   ,     atol=1e-4						)						)


