Commit
•
8906400
1
Parent(s):
07d8daf
Update app.py
Browse files
app.py
CHANGED
@@ -6,13 +6,7 @@ from tensorflow.keras.models import load_model
|
|
6 |
|
7 |
|
8 |
|
9 |
-
|
10 |
-
# hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "weather-madrid-flags")
|
11 |
-
|
12 |
-
def predict_energy(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13):
|
13 |
-
# input_feature = [f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13]
|
14 |
-
# if f0 is not None:
|
15 |
-
# if f= == "Custom LSTM":
|
16 |
|
17 |
weather_input = [f1,f2,f3,f4,f5,f6]
|
18 |
history_input =[f7,f8,f9,f10,f11,f12,f13]
|
@@ -25,8 +19,6 @@ def predict_energy(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13):
|
|
25 |
input_feature = np.concatenate((scaled_weather_input_array[0],history_input_array[0]))
|
26 |
|
27 |
model = load_model('history_7_future_1.h5')
|
28 |
-
# dtc = load('dtc_model.sav')
|
29 |
-
# xgb = load('xgb_model.sav')
|
30 |
|
31 |
output = model.predict(input_feature.reshape(1,1,-1))
|
32 |
output = output[0][0]
|
@@ -63,13 +55,8 @@ weather_predictor_app = gr.Interface(fn=predict_energy,
|
|
63 |
examples = [[2,23,3.93,0.85,2.75,0,0.428821,0.507056,0.658782,0.722878,0.694360,0.657011,0.587121],
|
64 |
[8,15,23.34,0.45,5.32,0,0.341136,0.337360,0.332931,0.336212,0.338439,0.327198,0.316899],
|
65 |
[12,8,2.10,0.96,1.34,0.0,0.327180,0.278838,0.253315,0.247601,0.262393,0.326879,0.458636]],
|
66 |
-
|
67 |
-
# ["XGBoost", 16,12,8,11,7,4,94,69,52,1014,1012,1009,10,10,10,14,5,0,5,35,2004,10]],
|
68 |
-
title = "Energy Consumption Prediction (London)",
|
69 |
description="Enter parameters using sliders provided to predict the energy consumption.")
|
70 |
-
# theme = "darkhuggingface",
|
71 |
-
# css="footer {visibility: hidden}"
|
72 |
-
# flagging_callback=hf_writer
|
73 |
|
74 |
|
75 |
weather_predictor_app.launch(share=True)
|
|
|
6 |
|
7 |
|
8 |
|
9 |
+
def predict_energy(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13):
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
weather_input = [f1,f2,f3,f4,f5,f6]
|
12 |
history_input =[f7,f8,f9,f10,f11,f12,f13]
|
|
|
19 |
input_feature = np.concatenate((scaled_weather_input_array[0],history_input_array[0]))
|
20 |
|
21 |
model = load_model('history_7_future_1.h5')
|
|
|
|
|
22 |
|
23 |
output = model.predict(input_feature.reshape(1,1,-1))
|
24 |
output = output[0][0]
|
|
|
55 |
examples = [[2,23,3.93,0.85,2.75,0,0.428821,0.507056,0.658782,0.722878,0.694360,0.657011,0.587121],
|
56 |
[8,15,23.34,0.45,5.32,0,0.341136,0.337360,0.332931,0.336212,0.338439,0.327198,0.316899],
|
57 |
[12,8,2.10,0.96,1.34,0.0,0.327180,0.278838,0.253315,0.247601,0.262393,0.326879,0.458636]],
|
58 |
+
title = "Energy Consumption Prediction using Custom LSTM (London)",
|
|
|
|
|
59 |
description="Enter parameters using sliders provided to predict the energy consumption.")
|
|
|
|
|
|
|
60 |
|
61 |
|
62 |
weather_predictor_app.launch(share=True)
|