gsstec commited on
Commit
0b89d87
·
verified ·
1 Parent(s): 4c6b67b

Upload 4 files

Browse files
Files changed (2) hide show
  1. app.py +16 -1
  2. requirements.txt +2 -1
app.py CHANGED
@@ -1,5 +1,7 @@
1
  import gradio as gr
2
  import os
 
 
3
 
4
  # Simplified molecular docking API using RDKit for basic binding affinity estimation
5
  # This avoids the complexity of DiffDock setup while providing functional drug screening
@@ -97,6 +99,19 @@ def run_diffdock_inference(protein_pdb_content, ligand_smiles_string):
97
  "diffdock_confidence_score": -1.0
98
  }
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  # Create Gradio interface
101
  with gr.Blocks(title="GSS DiffDock Engine") as demo:
102
  gr.Markdown("# Gaston Software Solutions LLP — Window 8 Engine")
@@ -172,6 +187,6 @@ with gr.Blocks(title="GSS DiffDock Engine") as demo:
172
  # Launch with proper configuration for Hugging Face Spaces
173
  if __name__ == "__main__":
174
  demo.queue()
175
- demo.launch()
176
 
177
  # Made with Bob
 
1
  import gradio as gr
2
  import os
3
+ from fastapi import FastAPI
4
+ from fastapi.responses import JSONResponse
5
 
6
  # Simplified molecular docking API using RDKit for basic binding affinity estimation
7
  # This avoids the complexity of DiffDock setup while providing functional drug screening
 
99
  "diffdock_confidence_score": -1.0
100
  }
101
 
102
+ # 🌐 FastAPI app for custom endpoints
103
+ app = FastAPI()
104
+
105
+ @app.get("/ping")
106
+ async def ping():
107
+ """Health check endpoint for UptimeRobot monitoring"""
108
+ return JSONResponse({
109
+ "status": "online",
110
+ "service": "RDKit Drug-Likeness Engine",
111
+ "hardware": "HF_FREE_CPU_RDKIT_CORE",
112
+ "uptime": "active"
113
+ })
114
+
115
  # Create Gradio interface
116
  with gr.Blocks(title="GSS DiffDock Engine") as demo:
117
  gr.Markdown("# Gaston Software Solutions LLP — Window 8 Engine")
 
187
  # Launch with proper configuration for Hugging Face Spaces
188
  if __name__ == "__main__":
189
  demo.queue()
190
+ demo.launch(app=app) # Mount FastAPI app for custom endpoints
191
 
192
  # Made with Bob
requirements.txt CHANGED
@@ -8,4 +8,5 @@ gradio==4.36.1
8
  pandas==2.2.1
9
  pyyaml==6.0.1
10
  scipy==1.12.0
11
- networkx==3.2.1
 
 
8
  pandas==2.2.1
9
  pyyaml==6.0.1
10
  scipy==1.12.0
11
+ networkx==3.2.1
12
+ fastapi==0.109.0