parameter is a handler class for transforming the request and response of an AzureML endpoint to match with required schema. Since there are a wide range of models in the model catalog, each of which may process data differently from one another, a ContentFormatterBase class is provided to allow users to transform data to their liking. The following content formatters are provided:GPT2ContentFormatter: Formats request and response data for GPT2DollyContentFormatter: Formats request and response data for the Dolly-v2HFContentFormatter: Formats request and response data for text-generation Hugging Face modelsLLamaContentFormatter: Formats request and response data for LLaMa2Note: OSSContentFormatter is being deprecated and replaced with GPT2ContentFormatter. The logic is the same but GPT2ContentFormatter is a more suitable name. You can still continue to use OSSContentFormatter as the changes are backwards compatible.Below is an example using a summarization model from Hugging Face.Custom Content Formatter‚Äãfrom typing import Dictfrom langchain.llms.azureml_endpoint import AzureMLOnlineEndpoint, ContentFormatterBaseimport osimport jsonclass CustomFormatter(ContentFormatterBase):    content_type = "application/json"    accepts = "application/json"    def format_request_payload(self, prompt: str, model_kwargs: Dict) -> bytes:        input_str = json.dumps(            {                "inputs": [prompt],                "parameters": model_kwargs,                "options": {"use_cache": False, "wait_for_model": True},            }        )        return str.encode(input_str)    def format_response_payload(self, output: bytes) -> str:        response_json = json.loads(output)        return response_json[0]["summary_text"]content_formatter = CustomFormatter()llm = AzureMLOnlineEndpoint(    endpoint_api_key=os.getenv("BART_ENDPOINT_API_KEY"),    endpoint_url=os.getenv("BART_ENDPOINT_URL"),    model_kwargs={"temperature": 0.8, "max_new_tokens": 400},
Azure ML is a platform used to build, train, and deploy machine learning models. Users can explore the types of models to deploy in the Model Catalog, which provides Azure Foundation Models and OpenAI Models. Azure Foundation Models include various open-source models and popular Hugging Face models. Users can also import models of their liking into AzureML.
Azure ML is a platform used to build, train, and deploy machine learning models. Users can explore the types of models to deploy in the Model Catalog, which provides Azure Foundation Models and OpenAI Models. Azure Foundation Models include various open-source models and popular Hugging Face models. Users can also import models of their liking into AzureML. ->: parameter is a handler class for transforming the request and response of an AzureML endpoint to match with required schema. Since there are a wide range of models in the model catalog, each of which may process data differently from one another, a ContentFormatterBase class is provided to allow users to transform data to their liking. The following content formatters are provided:GPT2ContentFormatter: Formats request and response data for GPT2DollyContentFormatter: Formats request and response data for the Dolly-v2HFContentFormatter: Formats request and response data for text-generation Hugging Face modelsLLamaContentFormatter: Formats request and response data for LLaMa2Note: OSSContentFormatter is being deprecated and replaced with GPT2ContentFormatter. The logic is the same but GPT2ContentFormatter is a more suitable name. You can still continue to use OSSContentFormatter as the changes are backwards compatible.Below is an example using a summarization model from Hugging Face.Custom Content Formatter‚Äãfrom typing import Dictfrom langchain.llms.azureml_endpoint import AzureMLOnlineEndpoint, ContentFormatterBaseimport osimport jsonclass CustomFormatter(ContentFormatterBase):    content_type = "application/json"    accepts = "application/json"    def format_request_payload(self, prompt: str, model_kwargs: Dict) -> bytes:        input_str = json.dumps(            {                "inputs": [prompt],                "parameters": model_kwargs,                "options": {"use_cache": False, "wait_for_model": True},            }        )        return str.encode(input_str)    def format_response_payload(self, output: bytes) -> str:        response_json = json.loads(output)        return response_json[0]["summary_text"]content_formatter = CustomFormatter()llm = AzureMLOnlineEndpoint(    endpoint_api_key=os.getenv("BART_ENDPOINT_API_KEY"),    endpoint_url=os.getenv("BART_ENDPOINT_URL"),    model_kwargs={"temperature": 0.8, "max_new_tokens": 400},