thechaiexperiment commited on
Commit
4759971
·
verified ·
1 Parent(s): 9593a8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -16,24 +16,24 @@ def initialize_app():
16
 
17
  return general_success and medical_success
18
 
19
- # Health check endpoint that combines both domains
 
 
 
 
20
  @app.get("/health")
21
  async def health_check():
 
22
  status = {
23
  'status': 'healthy',
24
- 'general_models_loaded': bool(models),
25
- 'medical_models_loaded': 'ner_pipeline' in models,
26
  'embeddings_loaded': bool(data.get('embeddings')),
27
  'documents_loaded': not data.get('df', pd.DataFrame()).empty
28
  }
29
  return status
30
 
31
- # Run the combined application
 
32
  if __name__ == "__main__":
33
  import uvicorn
34
- if initialize_app():
35
- print("Application initialized successfully")
36
- uvicorn.run(app, host="0.0.0.0", port=7860)
37
- else:
38
- print("Warning: Application initialized with partial functionality")
39
- uvicorn.run(app, host="0.0.0.0", port=7860)
 
16
 
17
  return general_success and medical_success
18
 
19
+
20
+ @app.get("/")
21
+ async def root():
22
+ return {"message": "Welcome to TeaRAG! Your Medical Assistant Powered by RAG"}
23
+
24
  @app.get("/health")
25
  async def health_check():
26
+ """Health check endpoint"""
27
  status = {
28
  'status': 'healthy',
29
+ 'models_loaded': bool(models),
 
30
  'embeddings_loaded': bool(data.get('embeddings')),
31
  'documents_loaded': not data.get('df', pd.DataFrame()).empty
32
  }
33
  return status
34
 
35
+ if not init_success:
36
+ print("Warning: Application initialized with partial functionality")
37
  if __name__ == "__main__":
38
  import uvicorn
39
+ uvicorn.run(app, host="0.0.0.0", port=7860)