RaulHuarote commited on
Commit
1afba3c
1 Parent(s): c7dae18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -6,6 +6,11 @@ from pydantic import BaseModel
6
  import numpy as np
7
  from typing import List
8
 
 
 
 
 
 
9
  class InputData(BaseModel):
10
  data: List[float] # Lista de características numéricas (flotantes)
11
 
@@ -14,11 +19,11 @@ app = FastAPI()
14
  # Función para construir el modelo manualmente
15
  def build_model():
16
 
17
-
18
- with open('model.json', 'r') as json_file:
19
- loaded_model_json = json_file.read()
20
- model = tf.keras.models.model_from_json(loaded_model_json)
21
 
 
22
  """
23
  model = Sequential(
24
  [
 
6
  import numpy as np
7
  from typing import List
8
 
9
+ from keras.models import Sequential, Model, load_model
10
+ from keras.layers import Dropout, Flatten, Dense
11
+ from keras import optimizers
12
+ from keras.models import model_from_json
13
+
14
  class InputData(BaseModel):
15
  data: List[float] # Lista de características numéricas (flotantes)
16
 
 
19
  # Función para construir el modelo manualmente
20
  def build_model():
21
 
22
+ with open('model.json','r') as f:
23
+ json = f.read()
24
+ model = model_from_json(json)
 
25
 
26
+
27
  """
28
  model = Sequential(
29
  [