Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,17 +7,14 @@ import datasets
|
|
7 |
title = "Stoclholm Highway E4 Real Time Traffic Prediction"
|
8 |
description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction, updated in every hour"
|
9 |
|
10 |
-
inputs = [gr.Dataframe(row_count = (
|
11 |
|
12 |
outputs = [gr.Dataframe(row_count = (1, "fixed"), col_count=(1, "fixed"), label="Predictions", headers=["Congestion Level"])]
|
13 |
|
14 |
model = joblib.load("./traffic_model.pkl")
|
15 |
|
16 |
-
# we will give our dataframe as example
|
17 |
-
#df = datasets.load_dataset("merve/supersoaker-failures")
|
18 |
-
#df = df["train"].to_pandas()
|
19 |
|
20 |
def infer(input_dataframe):
|
21 |
return pd.DataFrame(model.predict(input_dataframe))
|
22 |
|
23 |
-
gr.Interface(fn = infer, inputs = inputs, outputs = outputs).launch()
|
|
|
7 |
title = "Stoclholm Highway E4 Real Time Traffic Prediction"
|
8 |
description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction, updated in every hour"
|
9 |
|
10 |
+
inputs = [gr.Dataframe(row_count = (7, "fixed"), col_count=(1,"fixed"), label="Input Data", interactive=1)]
|
11 |
|
12 |
outputs = [gr.Dataframe(row_count = (1, "fixed"), col_count=(1, "fixed"), label="Predictions", headers=["Congestion Level"])]
|
13 |
|
14 |
model = joblib.load("./traffic_model.pkl")
|
15 |
|
|
|
|
|
|
|
16 |
|
17 |
def infer(input_dataframe):
|
18 |
return pd.DataFrame(model.predict(input_dataframe))
|
19 |
|
20 |
+
gr.Interface(fn = infer, inputs = inputs, outputs = outputs, title=title, description=description).launch()
|