Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ async def predict(model: UploadFile = File(...), data: str = None):
|
|
20 |
# Load the model
|
21 |
model = load_model(temp_model_path, compile=False)
|
22 |
model.compile(optimizer=Adam(learning_rate=0.001), loss='mse', run_eagerly=True)
|
23 |
-
|
24 |
# Process the data
|
25 |
data = np.array(eval(data)).reshape(1, 12, 1)
|
26 |
predictions = model.predict(data).tolist()
|
@@ -37,6 +37,7 @@ async def retrain(model: UploadFile = File(...), data: str = None):
|
|
37 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".h5") as temp_model_file:
|
38 |
temp_model_file.write(await model.read())
|
39 |
temp_model_path = temp_model_file.name
|
|
|
40 |
|
41 |
|
42 |
# Load the model and data
|
|
|
20 |
# Load the model
|
21 |
model = load_model(temp_model_path, compile=False)
|
22 |
model.compile(optimizer=Adam(learning_rate=0.001), loss='mse', run_eagerly=True)
|
23 |
+
print(data)
|
24 |
# Process the data
|
25 |
data = np.array(eval(data)).reshape(1, 12, 1)
|
26 |
predictions = model.predict(data).tolist()
|
|
|
37 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".h5") as temp_model_file:
|
38 |
temp_model_file.write(await model.read())
|
39 |
temp_model_path = temp_model_file.name
|
40 |
+
print(data)
|
41 |
|
42 |
|
43 |
# Load the model and data
|