797e893eda
Some checks failed
s434704-predict-s426206-from-registry/pipeline/head There was a failure building this commit
28 lines
555 B
Python
28 lines
555 B
Python
|
|
import json
|
|
import mlflow
|
|
from mlflow.tracking import MlflowClient
|
|
import mlflow.pyfunc
|
|
import torch
|
|
import numpy as np
|
|
import pandas as pd
|
|
|
|
import sys
|
|
|
|
arguments = sys.argv[1:]
|
|
|
|
mlflow.set_tracking_uri("http://172.17.0.1:5000")
|
|
client = MlflowClient()
|
|
model_version = 1
|
|
model_name = "s426206"
|
|
|
|
input = str(arguments[0])
|
|
|
|
experiment = client.get_latest_versions(model_name, stages=None)
|
|
|
|
print(experiment)
|
|
|
|
with open(f'{model_name}/{input}', 'r') as file:
|
|
json_data = json.load(file)
|
|
|
|
print(model(torch.tensor(np.array(json_data['inputs'])).float())) |