MarjG commited on
Commit
b1accee
·
1 Parent(s): e5bb869

add psutil

Browse files
Files changed (2) hide show
  1. requirements.txt +1 -0
  2. test.py +7 -6
requirements.txt CHANGED
@@ -9,3 +9,4 @@ mlflow
9
  boto3
10
  scikit-learn
11
  python-multipart
 
 
9
  boto3
10
  scikit-learn
11
  python-multipart
12
+ psutil==7.0.0
test.py CHANGED
@@ -57,18 +57,19 @@ def test_prediction():
57
  r = requests.post("https://marjg-getaround-api.hf.space/predict", json=payload)
58
 
59
  response = r.json()
60
- print(pd.read_json(response))
61
-
62
- test_prediction()
63
 
64
 
65
  #### Test batch pred
66
  def test_batch():
67
- print("###test_test_batchprediction###")
68
 
69
  df = pd.read_csv("https://full-stack-assets.s3.eu-west-3.amazonaws.com/Deployment/get_around_pricing_project.csv", index_col=0)
70
-
71
- myfile = df.to_csv()
 
72
  r = requests.post("https://marjg-getaround-api.hf.space/batch-predict", files={"file": myfile})
73
 
74
  response = r.json()
 
57
  r = requests.post("https://marjg-getaround-api.hf.space/predict", json=payload)
58
 
59
  response = r.json()
60
+ print(round(response["prediction"], 2))
61
+
62
+ #test_prediction()
63
 
64
 
65
  #### Test batch pred
66
  def test_batch():
67
+ print("###test_batchprediction###")
68
 
69
  df = pd.read_csv("https://full-stack-assets.s3.eu-west-3.amazonaws.com/Deployment/get_around_pricing_project.csv", index_col=0)
70
+
71
+ df = df.iloc[:, :-1]
72
+ myfile = df.to_csv(index=False)
73
  r = requests.post("https://marjg-getaround-api.hf.space/batch-predict", files={"file": myfile})
74
 
75
  response = r.json()