init
This commit is contained in:
21
predict.py
Normal file
21
predict.py
Normal file
@ -0,0 +1,21 @@
|
||||
# predict.py
|
||||
#
|
||||
# author: deng
|
||||
# date : 20230221
|
||||
|
||||
import torch
|
||||
import mlflow
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
# set MLflow server
|
||||
mlflow.set_tracking_uri('http://127.0.0.1:5000')
|
||||
|
||||
# load production model
|
||||
model = mlflow.pytorch.load_model('models:/cls_model/production')
|
||||
|
||||
# predict
|
||||
fake_data = torch.randn(10)
|
||||
output = model(fake_data)
|
||||
print(output)
|
Reference in New Issue
Block a user