Upload app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,12 @@ import pandas as pd
|
|
10 |
from huggingface_hub import CommitScheduler
|
11 |
from pathlib import Path
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
# Configure the logging functionality
|
14 |
log_file = Path("logs/") / f"data_{uuid.uuid4()}.json"
|
15 |
log_folder = log_file.parent
|
@@ -63,7 +69,7 @@ def predict_insurance_charges(age, bmi, children, sex, smoker, region):
|
|
63 |
|
64 |
data_point = pd.DataFrame([sample])
|
65 |
|
66 |
-
|
67 |
|
68 |
with scheduler.lock:
|
69 |
with log_file.open("a") as f:
|
@@ -101,8 +107,4 @@ gr_interface.queue()
|
|
101 |
gr_interface.launch(share=False)
|
102 |
|
103 |
print('*** Running train.py ***')
|
104 |
-
import subprocess
|
105 |
|
106 |
-
# Run the training script
|
107 |
-
subprocess.run(["python", "train.py"])
|
108 |
-
print('*** done! ***')
|
|
|
10 |
from huggingface_hub import CommitScheduler
|
11 |
from pathlib import Path
|
12 |
|
13 |
+
import subprocess
|
14 |
+
|
15 |
+
# Run the training script
|
16 |
+
subprocess.run(["python", "train.py"])
|
17 |
+
print('done!')
|
18 |
+
|
19 |
# Configure the logging functionality
|
20 |
log_file = Path("logs/") / f"data_{uuid.uuid4()}.json"
|
21 |
log_folder = log_file.parent
|
|
|
69 |
|
70 |
data_point = pd.DataFrame([sample])
|
71 |
|
72 |
+
prediction = insurance_charge_predictor.predict(data_point).tolist()
|
73 |
|
74 |
with scheduler.lock:
|
75 |
with log_file.open("a") as f:
|
|
|
107 |
gr_interface.launch(share=False)
|
108 |
|
109 |
print('*** Running train.py ***')
|
|
|
110 |
|
|
|
|
|
|