namanraj commited on
Commit
70bd101
·
verified ·
1 Parent(s): be002ae

Update app/main.py

Browse files
Files changed (1) hide show
  1. app/main.py +4 -6
app/main.py CHANGED
@@ -9,7 +9,7 @@ app = FastAPI()
9
 
10
 
11
  origins = [
12
- "https://namanrajput-git.github.io/RT_Digit_Recognizer-Frontend/", # your frontend URL
13
 
14
  ]
15
 
@@ -21,17 +21,15 @@ app.add_middleware(
21
  allow_headers=["*"],
22
  )
23
 
24
- # Debug: print current directory and files
25
  print("Current working directory:", os.getcwd())
26
  print("Files in app folder:", os.listdir("."))
27
 
28
- # Load model (must match filename)
29
  model_path = "best_model.h5"
30
  model = keras.models.load_model(model_path)
31
-
32
- # Input schema
33
  class InputData(BaseModel):
34
- pixels: list # 784 flattened pixels (28x28)
35
 
36
  @app.get("/")
37
  def root():
 
9
 
10
 
11
  origins = [
12
+ "https://namanrajput-git.github.io/RT_Digit_Recognizer-Frontend/",
13
 
14
  ]
15
 
 
21
  allow_headers=["*"],
22
  )
23
 
24
+
25
  print("Current working directory:", os.getcwd())
26
  print("Files in app folder:", os.listdir("."))
27
 
28
+
29
  model_path = "best_model.h5"
30
  model = keras.models.load_model(model_path)
 
 
31
  class InputData(BaseModel):
32
+ pixels: list
33
 
34
  @app.get("/")
35
  def root():