Spaces:
Runtime error
Runtime error
Ziyou Li
commited on
Commit
·
9ea796e
1
Parent(s):
ce5d860
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ def get_row():
|
|
38 |
vis = json_response_smhi["timeSeries"][0]["parameters"][9]["values"][0] # Visibility
|
39 |
|
40 |
# Use current time
|
41 |
-
referenceTime =
|
42 |
|
43 |
row ={"referenceTime": referenceTime,
|
44 |
"temperature": t,
|
@@ -58,7 +58,8 @@ model = joblib.load(cached_download(
|
|
58 |
))
|
59 |
|
60 |
def infer(input_dataframe):
|
61 |
-
|
|
|
62 |
|
63 |
title = "Stoclholm Highway E4 Real Time Traffic Prediction"
|
64 |
description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction"
|
|
|
38 |
vis = json_response_smhi["timeSeries"][0]["parameters"][9]["values"][0] # Visibility
|
39 |
|
40 |
# Use current time
|
41 |
+
referenceTime = time.time().strftime("%m/%d/%Y %H:%M:%S")
|
42 |
|
43 |
row ={"referenceTime": referenceTime,
|
44 |
"temperature": t,
|
|
|
58 |
))
|
59 |
|
60 |
def infer(input_dataframe):
|
61 |
+
input_dataframe["referenceTime"] = dp.parse(input_dataframe["referenceTime"]).timestamp()
|
62 |
+
return pd.DataFrame(model.predict(input_dataframe)).clip(0, 1)
|
63 |
|
64 |
title = "Stoclholm Highway E4 Real Time Traffic Prediction"
|
65 |
description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction"
|