record model input&output, save model to file system
This commit is contained in:
11
predict.py
11
predict.py
@ -13,9 +13,12 @@ if __name__ == '__main__':
|
||||
mlflow.set_tracking_uri('http://127.0.0.1:5000')
|
||||
|
||||
# load production model
|
||||
model = mlflow.pytorch.load_model('models:/cls_model/production')
|
||||
model = mlflow.pytorch.load_model('models:/fortune_predict_model/production')
|
||||
|
||||
# predict
|
||||
fake_data = torch.randn(10)
|
||||
output = model(fake_data)
|
||||
print(output)
|
||||
my_personal_info = torch.randn(5)
|
||||
my_fortune = model(my_personal_info)
|
||||
print(my_fortune)
|
||||
|
||||
# save model and env to local file system
|
||||
mlflow.pytorch.save_model(model, './fortune_predict_model')
|
Reference in New Issue
Block a user