24 lines
575 B
Python
24 lines
575 B
Python
|
"""
|
||
|
Script to use real-time inferencing with online endpoints
|
||
|
"""
|
||
|
from azml_03_realtime_inference import online_endpoint_name
|
||
|
from ml_client import create_or_load_ml_client
|
||
|
|
||
|
|
||
|
def main():
|
||
|
# 1. Load a Workspace
|
||
|
ml_client = create_or_load_ml_client()
|
||
|
|
||
|
# 2. Get predictions
|
||
|
output = ml_client.online_endpoints.invoke(
|
||
|
endpoint_name=online_endpoint_name,
|
||
|
deployment_name=online_endpoint_name,
|
||
|
request_file="./diabetes_test_inference/request.json",
|
||
|
)
|
||
|
|
||
|
print(output)
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|