sdafd commited on
Commit
99d22e0
·
verified ·
1 Parent(s): 3b4336f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -30,7 +30,7 @@ async def predict(model: UploadFile = File(...), data: str = None):
30
  raise HTTPException(status_code=500, detail=str(e))
31
 
32
  @app.post("/retrain")
33
- async def retrain(model: UploadFile = File(...), data: UploadFile = File(...)):
34
  try:
35
  # Save the uploaded model and data to temporary files
36
  with tempfile.NamedTemporaryFile(delete=False, suffix=".h5") as temp_model_file:
@@ -43,7 +43,7 @@ async def retrain(model: UploadFile = File(...), data: UploadFile = File(...)):
43
 
44
  # Load the model and data
45
  model = load_model(temp_model_path, compile=False)
46
- dataset = np.load(temp_data_path)
47
 
48
  # Normalize the data
49
  scaler = MinMaxScaler()
 
30
  raise HTTPException(status_code=500, detail=str(e))
31
 
32
  @app.post("/retrain")
33
+ async def retrain(model: UploadFile = File(...), data: str = None):
34
  try:
35
  # Save the uploaded model and data to temporary files
36
  with tempfile.NamedTemporaryFile(delete=False, suffix=".h5") as temp_model_file:
 
43
 
44
  # Load the model and data
45
  model = load_model(temp_model_path, compile=False)
46
+ dataset = np.array(eval(data)).reshape(1, 12, 1)
47
 
48
  # Normalize the data
49
  scaler = MinMaxScaler()