Kalpokoch commited on
Commit
66e1c5a
·
1 Parent(s): a93b6ed

Fix validation import: move to top-level and trigger rebuild

Browse files

- Move save_validation_to_db import to module level (line 22)
- Remove redundant import from inside validate_prediction function
- Add version number to force HF Spaces rebuild
- Ensures proper function resolution at startup

Files changed (1) hide show
  1. main.py +2 -3
main.py CHANGED
@@ -1,6 +1,7 @@
1
  """
2
  FastAPI Backend for Virus Prediction System
3
  Optimized for Hugging Face Spaces Free Tier with MongoDB Atlas
 
4
  """
5
 
6
  from fastapi import FastAPI, HTTPException, status
@@ -20,7 +21,7 @@ from model_handler import (
20
  )
21
 
22
  # Database imports
23
- from data_handler import save_prediction_to_db, get_db_health, get_prediction_stats
24
 
25
  # Configure logging
26
  logging.basicConfig(level=logging.INFO)
@@ -351,8 +352,6 @@ async def validate_prediction(validation: ValidationRequest):
351
  - Stored in MongoDB for analysis
352
  """
353
  try:
354
- from data_handler import save_validation_to_db
355
-
356
  # Map virus ID to virus name
357
  actual_virus_name = ""
358
  actual_virus_key = ""
 
1
  """
2
  FastAPI Backend for Virus Prediction System
3
  Optimized for Hugging Face Spaces Free Tier with MongoDB Atlas
4
+ Version: 1.0.1
5
  """
6
 
7
  from fastapi import FastAPI, HTTPException, status
 
21
  )
22
 
23
  # Database imports
24
+ from data_handler import save_prediction_to_db, save_validation_to_db, get_db_health, get_prediction_stats
25
 
26
  # Configure logging
27
  logging.basicConfig(level=logging.INFO)
 
352
  - Stored in MongoDB for analysis
353
  """
354
  try:
 
 
355
  # Map virus ID to virus name
356
  actual_virus_name = ""
357
  actual_virus_key = ""