MS AI School Day 24

Joy·2023년 5월 4일
0

MS AI School

목록 보기
25/101

GPU

Designer

히스토그램(histogram)

연봉예측 모델과 활용

결과

Azure Machine Learning의 파이프라인 엔드포인트를 제출하기 위한 Swagger API

Regenerate response마다 다른답변

from azureml.core.authentication import InteractiveLoginAuthentication
from azureml.pipeline.core import PipelineEndpoint
import requests

Azure AD 인증을 사용하여 인증

interactive_auth = InteractiveLoginAuthentication()

Azure Machine Learning 워크스페이스에 연결

ws = Workspace.from_config(auth=interactive_auth)

파이프라인 엔드포인트 가져오기

pipeline_endpoint = PipelineEndpoint.get(workspace=ws, name="my-pipeline-endpoint")

파이프라인 엔드포인트 제출 URL

submit_url = "https://eastus2.api.azureml.ms/pipelines/v1.0/pipelineEndpoints/{}/submit".format(pipeline_endpoint.id)

HTTP POST 요청 헤더와 바디

headers = {
"Authorization": "Bearer " + interactive_auth.get_authentication_header().get("Authorization"),
"Content-Type": "application/json"
}
body = {
"experimentName": "my-experiment",
"runName": "my-run",
"pipelineParameters": {
"param1": "value1",
"param2": "value2"
}
}

요청 보내기

response = requests.post(submit_url, headers=headers, json=body)

응답 출력

print(response.status_code)
print(response.json())

Automated ML

MLOps

profile
🐣비전공자의 AI 입문기🐣

0개의 댓글