Add tensor
This commit is contained in:
parent
fa55fe7670
commit
33c19f9112
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import mlflow
|
import mlflow
|
||||||
|
import torch
|
||||||
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@ -14,5 +16,4 @@ model = mlflow.pytorch.load_model("my_model")
|
|||||||
with open(f'my_model/{input}', 'r') as file:
|
with open(f'my_model/{input}', 'r') as file:
|
||||||
json_data = json.load(file)['inputs']
|
json_data = json.load(file)['inputs']
|
||||||
|
|
||||||
data_into_dict = {idx:x for idx, x in enumerate(json_data)}
|
print(model(torch.tensor(np.array(json_data['inputs'])).float()))
|
||||||
print(model(pd.DataFrame([data_into_dict])))
|
|
Loading…
Reference in New Issue
Block a user