



import requests







def snake_case__  (			__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE )		->							None:
		UpperCAmelCase_						=				{"Content-Type": "application/json"}
		UpperCAmelCase_						=				requests.post(__SCREAMING_SNAKE_CASE			,     json={"text": message_body}			,     headers=__SCREAMING_SNAKE_CASE )
		if response.status_code != 200:
				UpperCAmelCase_						=				(
				    "Request to slack returned an error "
				    f'''{response.status_code}, the response is:\n{response.text}'''
				)
				raise ValueError(__SCREAMING_SNAKE_CASE )


if __name__ == "__main__":
			# Set the slack url to the one provided by Slack when you create the webhook at
			# https://my.slack.com/services/new/incoming-webhook/
			send_slack_message("<YOUR MESSAGE BODY>", "<SLACK CHANNEL URL>")






import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
			from transformers import AutoModelForSeqaSeqLM, AutoTokenizer



@require_torch
@require_sentencepiece
@require_tokenizers
class 	lowerCamelCase      (						unittest.TestCase  ):







					'''simple docstring'''







					@slow
					def    A__		(			self     ):
							UpperCAmelCase_						=				AutoModelForSeqaSeqLM.from_pretrained("google/mt5-small"    ,	return_dict=lowerCAmelCase     ).to(lowerCAmelCase     )
							UpperCAmelCase_						=				AutoTokenizer.from_pretrained("google/mt5-small"     )

							UpperCAmelCase_						=				tokenizer("Hello there"    ,	return_tensors="pt"     ).input_ids
							UpperCAmelCase_						=				tokenizer("Hi I am"    ,	return_tensors="pt"     ).input_ids

							UpperCAmelCase_						=				model(input_ids.to(lowerCAmelCase     )    ,	labels=labels.to(lowerCAmelCase     )     ).loss
							UpperCAmelCase_						=				-(labels.shape[-1] * loss.item())

							UpperCAmelCase_						=				-84.9127
							self.assertTrue(abs(mtf_score - EXPECTED_SCORE     ) < 1e-4     )

